NQL time selection

In NQL you can specify the time frame in various formats.

NQL during past

The during past clause allows you to filter your results by specifying a particular time period leading up to the present. The time can be expressed in minutes, hours or days.

Examples:

Retrieving the number of navigations in the past 45 minutes.

web.page_views during past 45min
| summarize total_navigations = number_of_page_views.sum()

Retrieving the number of navigations in the past 12 hours.

web.Page_views during past 12h
| summarize total_navigations = number_of_page_views.sum() 

Retrieving the number of navigations in the past 3 days.

web.Page_views during past 3d
| summarize total_navigations = number_of_page_views.sum() 

NQL from to

The from to clause allows you to apply custom timeframe filters when querying event tables.

Examples:

The number of navigations from June 1, 2023 to June 15, 2023

web.page_views from Jun 1, 2023 to Jun 15, 2023
| summarize total_navigations = number_of_page_views.sum() 

The number of navigations from June 15, 2023 at 12:30 to June 15, 2023 at 16:15

web.page_views from Jun 15, 2023, 12:30 to Jun 15, 2023, 16:15
| summarize total_navigations = number_of_page_views.sum()

The number of navigations from 2023-02-01 00:00:00 to 2023-02-28 23:45:00

web.page_views from 2023-02-01 00:00:00 to 2023-02-28 23:45:00
| summarize total_navigations = number_of_page_views.sum()

The number of navigations from 2023-02-01 to 2023-02-28

web.page_views from 2023-02-01 to 2023-02-28
| summarize total_navigations = number_of_page_views.sum()

For more information about the allowed date formats, refer to the NQL data types section. Note that the autocomplete functionality in the NQL editor provides suggestions with available data formats.

NQL on

The on clause allows you to select a specific day when querying data.

Examples:

The number of navigations on July 15, 2023

web.page_views on Jul 15, 2023
| summarize total_navigations = number_of_page_views.sum() 
web.page_views on 2023-06-15
| summarize total_navigations = number_of_page_views.sum() 

Time granularity and retention

When queries involve past time periods, they are converted into specific timeframes. Users have the flexibility to choose the precision level for time selection. Use minutes or hours in NQL time specification to retrieve more granular data. Use days to retrieve less granular data typically covering a longer time span.

Note that data storage and granularity also depend on specific tables. Refer to the Data resolution and retention documentation page for more details.

Time zones

When the Nexthink cloud instance is located in a different time zone from that of the user, the time selection units determine which time zone is considered for defining the beginning and end of the specified time period.

  • Full-day timeframes (e.g. during past 2d, from 2024-02-07 to 2024-02-08, on Feb 8, 2024) use the cloud instance timezone.

  • Timeframes expressed in hours and minutes (e.g. during past 15min, from 2024-02-07 14:45:00 to 2024-02-08 14:45:00) use the user timezone.

This distinction applies solely to the time period covered in the query. The results will always be displayed in the time zone of the user.

Example:

Let's consider how this would work in a real-world scenario.

Suppose two Nexthink users query the data using the Nexthink platform set to Eastern Time (ET).

  • The first user operates in the same time zone as the Nexthink platform. The current time for them is November 11, 05:26:15.

  • The second user operates in the Central European Time (CET) zone. The current time for them is November 11, 11:26:15.

In such a case, time-related queries made by the second Nexthink user will be translated into the corresponding timeframes, considering the time zone differences between CET and ET. This ensures accurate data retrieval and analytics, regardless of geographical location or time zone.

Timeframe selection
Nexthink user in the Eastern Time (ET) zone - the same zone as the Nexthink platform:
Nexthink user in the Central European Time (CET) zone:

past 15min

Nov 11, 05:15:00 AM – 05:30:00 AM ET​

Nov 11, 11:15:00 AM – 11:30:00 AM CET

past 2h

Nov 11, 04:00:00 AM – 06:00:00 AM ET​

Nov 11, 10:00:00 AM – 12:00:00 PM CET

past 24h

Nov 10, 06:00:00 AM – Nov 11 06:00:00 AM ET​

Nov 10, 12:00:00 PM – Nov 11, 12:00:00 PM CET

from 2021-11-11 00:00:00 to 2021-11-11 12:00:00

from 2021-11-11 12:00:00 AM to 2021-11-11 12:00:00 PM

from 2021-11-11 12:00:00 AM to 2021-11-11 12:00:00 PM

past 1d

Nov 11, 12:00:00 AM – Nov 12, 12:00:00 AM ET

Nov 11, 06:00:00 – Nov 12, 06:00:00 CET

on Nov 10, 2021

Nov 10, 12:00:00 AM – Nov 11, 12:00:00 AM ET​

Nov 10, 06:00:00 – Nov 11, 06:00:00 CET

Last updated