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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
geogou1973
Creator
Creator

Current vs previous sales

Hello.

I'm looking for days a formula with set analysis, when i select the day of the current year to show me in a chart the current selected day sales and the previous day sales (-364 days)
For example if i select 23/10/2013 to shows me the sales for 23/10/2013 and the sales for 24/10/2012.

I can't find anything. Can someone help me with this problem?

I have an attach file below.

Thank you in advance.

1 Solution

Accepted Solutions
mdmukramali
Specialist III
Specialist III

Dear,

Kindly find the attachment.

Thanks,

Mukram.

View solution in original post

4 Replies
mdmukramali
Specialist III
Specialist III

Dear,

Kindly find the attachment.

Thanks,

Mukram.

rustyfishbones
Master II
Master II

Try


Sum({< DATE = {'$(=DATE(Today()))', '$(=DATE(AddYears(Today(), -1)))'} >} SALES)

geogou1973
Creator
Creator
Author

Thank you very much.

It was so simple with the variable.

geogou1973
Creator
Creator
Author

Dear Mohammed i try to apply this formula to compare the current and the previous sales by giving the year and the month but i don't have a result for the previous.

I create a variable for the previous year    vPreviousYear=max(YEAR)-1

and in set analysis i write the following:

=Sum({<YEAR={'$(vPreviousYear)'},MONTH=>}sales)

What i do wrong.

Can you help me ?