SQL Grid Tile & Page Timeframe

Newb question…
Is it possible to utilize the page timeframe with a SQL Grid tile? It would make the page dynamic as to the results returned if the data timestamp in the SQL table is, for example, in the last 12 hours.

Hello @scottbanyas,

Yes, it’s possible. Check out this KB post:

A section on the page titled “How to use the page timeframe in your SQL query” explains how to do it. Basically, you put {{timeframe.isoStart}} in your query, and at run time, the variable is converted to a DateTime field.

For example:
SELECT {{timeframe.isoDuration}} as [isoDuration];

I have also been playing with page timeframe and SQL lately, and I have a sample dashboard mostly written that might make a good contribution to GitHub as an example.



@scottbanyas, I just uploaded a sample dashboard and a reference page to the GitHub repository: SquaredUp GitHub Sample repository

It’s currently waiting for two approvers, but if you can’t wait, click on the Branch link, then look for the Page-Timeframe branch, then SQL followed by Page-timeframe.md for the reference page.

The sample dashboard can be found in a similar way. Click on the branch link, then look for the Page-Timeframe branch, then Dashboards followed by sql-page-timeframe. There are two sample dashboards, one for Dashboard Server and one for SquaredUp for SCOM.



Merged in Shawn

1 Like