Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
jorditorras
Creator
Creator

Calculate KPI for 7AM and 7PM

Dear Gurus,

I have a table in QlikSense with one record per minute each day and some KPI's. Something like:

DateAndTimeTemperature
04/08/2017  8:42:00235
04/08/2017  8:43:00435
04/08/2017  8:44:00254
04/08/2017  8:45:00534
04/08/2017  8:46:00353
04/08/2017  8:47:00252
......

In the application it will be possible to select one single day. I would need to have 3 different KPI's:

Temperature of selected day at 7:00:00 AM

Temperature of selected day at 7:00:00 PM

Temperature of the next day at 7:00:00 AM.

Can anybody help me with these calculations?

Many thanks in advanced!

Regards,

Jordi

1 Solution

Accepted Solutions
sunny_talwar

May be this

May be like this

Dimension

DateandTime

Expression

Only({<DateandTime = {"=Match(Hour(DateandTime), 7, 19) and Minute(DateandTime) = 0 and Second(DateandTime) = 0"}>}Temp)

View solution in original post

4 Replies
Anil_Babu_Samineni

But, in your sample data there is not time like 7:00 AM/PM ...??

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

May be this

May be like this

Dimension

DateandTime

Expression

Only({<DateandTime = {"=Match(Hour(DateandTime), 7, 19) and Minute(DateandTime) = 0 and Second(DateandTime) = 0"}>}Temp)

jorditorras
Creator
Creator
Author

Well, what I meant is:

If the user selects Date=04/08/2017,

then I'd have to show the temperature of:

04/08/2017 7:00:00,

04/08/2017 19:00:00

05/08/2018 7:00:00

Thanks,

Regards,

Jordi

jorditorras
Creator
Creator
Author

Hi Sunny,

Thanks for your colaboration. It was very useful to focus the way of calculting my KPI. This wasn't exactly what I was looking for, as in this case it only shows this result when selecting specifically these Times. But your answer it correct as it fits with the way I asked. I finally created a set analysis as:

Avg({$<DateAndTime={'07:00:00'}>}[Temperature])

Thank your very much for your help!!

Regards,

Jordi