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

compare current vs previous sales

Hello.

How can i compare the current sales vs previous sales giving only the current year date in the selections and the chart giving me also the previous sale date in the same period and in the same weekday. Also if i give the month compare automatically the sales in the previous year. Is there any set analysis to do this ?

Thank you in advance.

2 Replies
jagan
Luminary Alumni
Luminary Alumni


Hi,

Try like this

For Current Selections

=Sum(Sales)

For Previous Year

=Sum({<Year=, Month=, Quarter=,Week=,DateDimension={'>=$(=YearStart(Max(DateDimension), -1))<=$(=YearEnd(Max(Date), -1))'}>}Sales)

In the above expression replace DateDimension with your date field name, Year with Year field etc.  Year= is used to ignore the selections.

Regards,

Jagan.

Not applicable

Hi

for previous year

sum({<yearfield={"=$(=only(yearfiled)-1)"},quarterfiled=,monthfield={"=$(=max(monthfiled)-1)"}>}sales)

if month is in monthnames then use month number function.