Related Articles
Creating an SQL-based Count Widget
On the drawer taskbar, click on Content buttonÂ
From the list of available widget, select SQL Count Widget
Configure the newly added count widget by clicking on the Edit Widget Settings Icon on the upper right corner of the widget.
On the settings page, supply the title, description, data source, SQL query name and have the option to set drill down and scoping features.Â
System-defined variables can also be used to add dynamic values into your SQL Query such as current user's Name, Id, Support Groups and Language Preference, as well as the current date + or - a number of days. For more information about System-defined Variables, please see this KB article:Â KB2567 - User Guide: System-Defined Variables
Example SQL Count Query:
SELECT count(*) AS 'Count'
FROM WorkItem
WHERE LastModified > dateadd(DAY,-7,getdate())
Note:Â The SQL Count widget will expect a count with a column name to be returned from the SQL query; not a set of records.
Click on the Apply button to refresh the count.
To learn more about how to add or modify the selected SQL query, please refer to the article on How to: Manage dashboard queries (KB1374).
On the drawer taskbar, click on Save to save the changes on the page.Â