Creating a Custom Usage Analytics dashboard
- 10-28-2024
This is what I came up with regarding the KPIs that I was trying to achieve. I created a subquery to capture the number of views per dashboard based on the action 'dashboard. loads'. I ran the subquery from the DimDashboards dimensional table that has already been created and added a value called "Dashboardloads".
SELECT distinct o.DashboardID AS [Dashboard ID], o.dashboardPath AS [Dashboard Path], CASE WHEN StrParts(o.dashboardPath,'/',1) like '' THEN 'null' ELSE StrParts(o.dashboardPath,'/',1) END AS [Dashboard Folder], o.dashboardTitle AS [Dashboard Name], (SELECT Count(*) FROM FactActions WHERE FactActions.[Dashboard ID] = o.DashboardID AND FactActions.[Action] = 'dashboard.load') AS Dashboardloads FROM [usage] o WHERE o.[category] = 'Analytics'
The subquery:
(SELECT Count(*) FROM FactActions WHERE FactActions.[Dashboard ID] = o.DashboardID AND FactActions.[Action] = 'dashboard.load') AS Dashboardloads
Queries from FactActions where we have the DashboardID equals that DashboardId from Usage and the Action equates to 'dashboard.load'. From there I was able to use the RANK function from Sisense to see which Dashboards rank the highest.
Then I created another dimensional table called "FactUserDashboardLoadCount" where the query:
SELECT fa.[Dashboard ID], dd.[Dashboard Name], fa.[User ID], dm.[User Name], (SELECT COUNT(FactActions.[Dashboard ID]) FROM FactActions WHERE FactActions.[Dashboard ID] = fa.[Dashboard ID] AND FactActions.[User ID] = fa.[User ID] AND FactActions.[Action] = 'dashboard.load' ) AS LoadCount FROM FactActions fa LEFT JOIN DimUsers dm on fa.[User ID] = dm.[User ID] LEFT JOIN DimDashboards dd on fa.[Dashboard ID] = dd.[Dashboard ID] GROUP BY fa.[Dashboard ID], fa.[User ID], dm.[User Name], dd.[Dashboard Name]
Which counts all the dashboards, that have a Dashboard ID, User ID, and 'dashboard.load' to determine how many times a user has viewed a specific dashboard.
I believe this answers my questions and any feedback is welcomed.