Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Last 12hours Trend

Dear All,

  We have requirement like, The report should show allways the last 12 hours as a dimension and sales as my expression.(Sales Trend for last 12hours).

For Example now the time is afternoon 12PM and i need a report for previous 12hrs like from 12PM to 12AM.

please suggest work arround.I am having the Date field with the Time stamp.

Thanks & Regards,

Santhosh Kumar G

1 Solution

Accepted Solutions
Not applicable
Author

Hi Santhosh

If you change the expression to filter for the last 12 hours, and make sure that "suppress zero values" is checked in the presentation tab of the chart properties, then only the last 12 hours will show in the dimension.

Probably best to set a variable that works out the time  -12 hours and set that in the expression:

eg v_time_L12 = timestamp(now()-(Time#(12,'hh')))

then the expression would look something like

=sum({<DateTimeField={">=$(v_time_L12)"}>} Sales)

If the "suppress zero values" is checked only the last 12 hours will show.

Let me know how you get on

Regards,

Erica

View solution in original post

1 Reply
Not applicable
Author

Hi Santhosh

If you change the expression to filter for the last 12 hours, and make sure that "suppress zero values" is checked in the presentation tab of the chart properties, then only the last 12 hours will show in the dimension.

Probably best to set a variable that works out the time  -12 hours and set that in the expression:

eg v_time_L12 = timestamp(now()-(Time#(12,'hh')))

then the expression would look something like

=sum({<DateTimeField={">=$(v_time_L12)"}>} Sales)

If the "suppress zero values" is checked only the last 12 hours will show.

Let me know how you get on

Regards,

Erica