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.
-- [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 |