Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
linoyel
Specialist
Specialist

Set analysis - calculate yesterday's sales

Hi,

I'm having trouble in calculate yesterday's sales in set analysis.

The today's sales formula works:

Sum({<DateNum={"$(=Max(DateNum))"}>} Value)

But yesterday's sales formula does not:

Sum({<DateNum={"$(=Max(DateNum-1))"}>} Value)

What's wrong?

33 Replies
linoyel
Specialist
Specialist
Author

Indeed it works in the sample app.

But not in my production app!

I really don't know why.

I'll try to load previous date in script calendar like arvind654 suggested

sunny_talwar

Another approach like this might help

The As-Of Table

MK9885
Master II
Master II

I'm not sure if it will give you what you looking for as it's not a flag but just Dates or Day...

I cannot imagine a valid scenario..

I'll see if I can create a flag

linoyel
Specialist
Specialist
Author

OK.

I found the really stupid mistake I've made:

In the filter pane in the Date field was written: =Date(Date)

(attached).

and that's why all selections in that field corrupted my correct formula which is:

Sum({<$(vSetAnalysisExceptTimes), DateNum={"$(=Max(DateNum-1))"}>} Value)


THANKS EVERYONE FOR ANSWERING, GIVING INTERESTING IDEAS AND BEING HELPFUL!!!