Skip to main content
Announcements
Qlik Launches Open Lakehouse and advanced agentic AI experience in Qlik Answers! | LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Like to Like sales comparison

Hi All,

Hope everyone is doing great.

I need help on calculating like to like sales comparison from last year to this year. Main criteria is i need to compare the sales for products which got sales in both years that means sales value in last year and sales value this year should not be zero (0).

I have to use the above calculation to derive top 5 and bottom 5 performing products (YOY % Change)in a bar chart.

I have used the below logic but not able to include "sales value in last year and sales value this year should not be zero " as the logic was out of rank function it is not  using the logic to avoid those products which have zero value in either year.

aggr(if((rank((Sum({<CurYTDFlag={1}>}SalesValue)-Sum({<LastYTDFlag={1}>}SalesValue))/fabs(Sum({<LastYTDFlag={1}>}SalesValue)),4)<=5

or rank(-(Sum({<CurYTDFlag={1}>}SalesValue)-Sum({<LastYTDFlag={1}>}SalesValue))

/fabs(Sum({<LastYTDFlag={1}>}SalesValue)),4)<=5) and Sum({<CurYTDFlag={1}>}SalesValue)<>0

and Sum({<LastYTDFlag={1}>}SalesValue)<>0,WP_ProductDescription),WP_ProductDescription)

Kindly help in this regard.

Thanks,

Nani

1 Reply
sunny_talwar

Would you be able to share a sample with expected output you are looking to get?