Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
nmalla
Contributor II
Contributor II

Same Store sales comparison

Dear all,
This is my first help request. I used to work with MS Power BI and pretty much known DAX formulas.
But new to Qlik and hard for me at this stage. Can some one help me, please?

Sales_Details excel file 

Current Year Sales:
Sum({<Year={"$(=Max(Year))"}>}TOTAL SalesAmount)

LastYearSales:
Sum({<Year={"$(=Max(Year)-1)"}>}TOTAL SalesAmount)

I created a pivot table and the Store name and week Number were added to dimensions and Channel and Value as Measures. On the right-hand side of pivotable, there is 3p, App, Web, etc and under that channel Sales Amount and Lastyersales are plotted.

nmalla_0-1704336268833.png

How can I check the current year's and last year's sales side by side for all channels? And also the growth.

Your support will be highly appreciated.

 

 

 

 

Labels (3)
2 Solutions

Accepted Solutions
PrashantSangle

Can you share your data?? with expected output. Also, tell us where you want to achieve it. in front end or in back end??

 

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

nmalla
Contributor II
Contributor II
Author

@PrashantSangle 

Thank you so much. That was my misunderstanding and that measure worked me perfectly.

I made a mistake  with Sum({<Year={"$(=Max(Year))"}>}TOTAL SalesAmount). I removed the total.

 

Thanks fr your help

View solution in original post

4 Replies
PrashantSangle

No need to use TOTAL in set analysis and nullify Year filter, try like

Current Year Sales:
Sum({<Year={"$(=Max(Year))"}>} SalesAmount)

LastYearSales:
Sum({<Year={"$(=Max(Year)-1)"},Year=>} SalesAmount)

 

Regards,

Prashant Sangle

 

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
nmalla
Contributor II
Contributor II
Author

Dear Prashant,

Thank you so much for the prompt support.
I have attached the result. I have dates, Sales Amounts, Current year Sales, and Previous Year Sales in columns.

In the year 2022  Current Year Sales:
Sum({<Year={"$(=Max(Year))"}>} SalesAmount) shows me the 0 value and 2023 as the correct value.

But in 2023  LastYearSales:
Sum({<Year={"$(=Max(Year)-1)"}, Year=>} SalesAmount) shows me the correct value for 2022 but the same value for 2023 as of the current year. I suppose it should be 0.

Any thoughts please?

PrashantSangle

Can you share your data?? with expected output. Also, tell us where you want to achieve it. in front end or in back end??

 

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
nmalla
Contributor II
Contributor II
Author

@PrashantSangle 

Thank you so much. That was my misunderstanding and that measure worked me perfectly.

I made a mistake  with Sum({<Year={"$(=Max(Year))"}>}TOTAL SalesAmount). I removed the total.

 

Thanks fr your help