Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
nicalbert
Partner - Contributor III
Partner - Contributor III

Using a timestamp is set analysis

Hello everyone,

I have been using this set analysis to show some KPIs for "yesterday" (i.e. today - 1), and it works really well:

=count({<ReceivedTimeStamp = {'>=$(=DayStart(today()-(1))))<$(=DayStart(today()))'},
Code = {1,2,3,4}>}
DISTINCT RunID)

I now need to modify it to show the same KPIs, but for a time period that goes from yesterday at 0700 to today at 0659. It's still a 24hrs period, but covering 2 days.

I'm totally lost with this one!!! Can anyone provide some guidance on how to achieve that? Or if this can be achieved at all...

Thanks!

Nic

1 Solution

Accepted Solutions
Kushal_Chawda

Assuming your time field is in proper timestamp format then you can try below. You can adjust the hours and minutes in maketime function within set.

Note: Maketime function always takes parameters as 24 hours format. So 3 PM can be written as maketime(15,00)

=count({<ReceivedTimeStamp = {">=$(=timestamp(floor(Today()-1)+maketime(07,00)))<=$(=timestamp(floor(Today())+maketime(06,59)))"},
Code = {1,2,3,4}>}
DISTINCT RunID)

View solution in original post

2 Replies
Kushal_Chawda

Assuming your time field is in proper timestamp format then you can try below. You can adjust the hours and minutes in maketime function within set.

Note: Maketime function always takes parameters as 24 hours format. So 3 PM can be written as maketime(15,00)

=count({<ReceivedTimeStamp = {">=$(=timestamp(floor(Today()-1)+maketime(07,00)))<=$(=timestamp(floor(Today())+maketime(06,59)))"},
Code = {1,2,3,4}>}
DISTINCT RunID)
nicalbert
Partner - Contributor III
Partner - Contributor III
Author

you totally made my day here! Your solution is exactly what I was looking for. 

Thank you very much,

Nic