# Dashboard Report - Logged In

**URL:** https://meta.discourse.org/t/dashboard-report-logged-in/291102
**Category:** Data & reporting
**Tags:** sql-query, dashboard-reports, dashboard-sql
**Created:** [January 10, 2024, 1:19am UTC](https://meta.discourse.org/t/dashboard-report-logged-in/291102 "2024-01-10T01:19:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![SaraDev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saradev/32/335139_2.png) [@SaraDev](https://meta.discourse.org/u/SaraDev)
#### Post date: [January 10, 2024, 1:19am UTC](https://meta.discourse.org/t/dashboard-report-logged-in/291102/1 "2024-01-10T01:19:09Z")

</div>

This is an SQL version of the Dashboard Report for Logged In.

This report provides a count of total pageviews from logged in users on a site each day between a specified start date and an end date.

```sql
-- [params]
-- date :start_date = 2023-12-08
-- date :end_date = 2024-01-10

SELECT
  date,
  SUM(count) AS pageviews
FROM
  application_requests
WHERE
  req_type = 7 
AND 
  date BETWEEN :start_date AND :end_date
GROUP BY
  date
ORDER BY
  date ASC

```

### SQL Query Explanation

This query uses two date parameters to define the `start_date` and `end_date` for the report, and selects the `date` and the sum of `count` as `pageviews` from the `application_requests` table. The query then filters records to include only those with a request type corresponding to logged in pageviews, groups results by date for an aggregated count, and orders the output in ascending order by date, offering a chronological view of user pageview activity within the selected period.

### Example Results

| date | new\_pageviews |
| --- | --- |
| 2023-12-08 | 1002 |
| 2023-12-09 | 455 |
| 2023-12-10 | 499 |
| 2023-12-11 | 1153 |
| 2023-12-12 | 964 |
