Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
wassimharfoush
Partner - Contributor II
Partner - Contributor II

Previous Day Sales

I am trying to get previous day sales. I tried this expression but did not work:

=Sum({$<DatField={'$(VarPreviousDay)'}>}SalesField)

The variable set as follow:

VarPreviousDay=Date(Today()-1,'MM/DD/YYYY')

5 Replies
Gysbert_Wassenaar

That should work if you use the same date format that DatField has, but only if you don't use DatField as dimension in your chart. A set analysis expression calculates one set per chart, not a set per row.


talk is cheap, supply exceeds demand
aveeeeeee7en
Specialist III
Specialist III

Hi wassim

First check that both formats are same or not.

You have made your variable date in 'MM/DD/YYYY' format.

Please check that your DatField is in the 'MM/DD/YYYY' format ir not.

If not than try changing it.

If Yes, than use this expression:

=Sum({$<DatField={'$(=(VarPreviousDay))'}>}SalesField)

Also, see the Attachment.

Regards

Aviral Nag

wassimharfoush
Partner - Contributor II
Partner - Contributor II
Author

The date format is the same format as the variable. And is not working for me any other suggestions?

Gysbert_Wassenaar

Post an example document that demonstrates the problem.


talk is cheap, supply exceeds demand
muniyandi
Creator III
Creator III

Hi Wassim,

your variable front of put equal.

pre date.png


try this expression.


Sum({$<DatField={'$(=VarPreviousDay)'}>}SalesField)

variable front of put equal.

Thanks,

Muni