Using a shift start time (e.g. 06:00) in analytics

Hi all,

In Tulip Analytics, I would like to create some analyses using DATE RANGE ‘Today’. However Today starts at 00:00:00

I would like to be able to set a shift start time of 06:00:00 and have my analyses use that as the start time.

It would be great if there was an option to do a time range on a certain day.

Another user requested something similar - Date calculation in analytics exspression

I also found this post: Using Shifts in Machine Data for Analytics on the Dashboard

Here a solution was proposed using an expression in the filter:

MID(DATE_TRUNC(Start Time, ‘hour’) +’’,11,5) = ‘17:00’

Please could this expression be explained? Is there any documentation available for describing expression syntax, other than the context help?

If I evaluate these separately,

DATE_TRUNC(Start Time, ‘hour’) evaluates to 20 July 2021 07:00

MID(DATE_TRUNC(Start Time, ‘hour’) +’’,11,5) evaluates to 06:00

I get that MID returns 5 characters after the eleventh character, but why does it return 06:00 when the time from the previous expression was 07:00

I tried using similar filter expressions to above:

MID(DATE_TRUNC(Start Time, ‘hour’) +’’,11,5) = ‘06:00’
MID(DATE_TRUNC(Start Time, ‘hour’) +’’,11,5) = ‘07:00’
MID(DATE_TRUNC(Start Time, ‘hour’) +’’,11,5) = ‘08:00’

but I get strange results - I would expect availability/utilization figures to go up because they are being calculated over a shorter period from 6AM, 7AM or 8AM rather than from midnight.

Any ideas?

Hey @kevin.moore,

Sorry for the delay here! This certainly is worth a feature request and we can go ahead and add that internally.

One thing to note here is that if you’re using analyses in an application, you can actually filter by particular datetime stamps. So you could have the analytic set to show some set of data (i.e. today, last 7 days, all-time), but then filter that return down even further using dynamic filters. Just set a start date variable to be 6 AM through the datetime input widget or through an expression like you’ve mentioned and say that your data should only show information greater than or equal to that variable.

Let me know if that helps here!