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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

timestamp set analysis expression for sum of sales

Hi,

I need to calculate sum of sales for the last 2 hrs sales and yesterday same 2 hrs sales.

example: if the today sales between 9:00 am - 11:am is 100, then yesterday same 9:00 am - 11: am 90

the set analysis expressions I am using are

Today last 2 hrs: Sum( $<timestamp={">=$(=max(timestamp))-2/24"}> Sales)

same 2 hrs yesterday: should be between 26/24 - 24/24....

Sum( $<timestamp={">=$(=max(timestamp))-26/24"}> Sales)

Sum( $<timestamp={"<=$(=max(timestamp))-24/24"}> Sales)

how do i use the above expressions in a single expression? or any other alternative?

Thanks in Advance

1 Solution

Accepted Solutions
pover
Partner - Master
Partner - Master

Are you looking for something like this?

Sum( $<timestamp={">=$(=max(timestamp))-26/24<=$(=max(timestamp))-24/24"}> Sales)

Regards.

View solution in original post

2 Replies
pover
Partner - Master
Partner - Master

Are you looking for something like this?

Sum( $<timestamp={">=$(=max(timestamp))-26/24<=$(=max(timestamp))-24/24"}> Sales)

Regards.

Not applicable
Author

Yes... Thank You.....