Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
maxsugak
Contributor
Contributor

Monthly comparison showing best and worst

Hi everyone, just need help again.

I have sellers and their sales.

I was asked to show only those sellers who were better this month then previous month.

And vice versa show those who were worse this month then previous.

 

I've tried to make set analysis like this:

sum({<month={$(=Max(Month))}>} Quantity*ProductCost)
- sum({<month={$(=Max(Month-1))}>} Quantity*ProductCost)

but got only zeros.

 

Thanks for your help.

 

Max

Labels (2)
3 Replies
pradosh_thakur
Master II
Master II

in which object are you using this exactly? if you can describe a bit more.

Try this may be assuming you have dates properly defined and the expression is what you need

sum({<month={"$(=Max(Month))"}>} Quantity*ProductCost)
- sum({<month={"$(=Max(Month)-1)"}>} Quantity*ProductCost)
Learning never stops.
maxsugak
Contributor
Contributor
Author

I have sales list for year 2013.
It states date of sale, seller, product ID and selled Quantity.
ProductCost is defined in different table.
OmarBenSalem

Simplest way : 

sellers who were better this month then previous month:

Create a bar chart:

as dimensions:

Month

Seller 

as a measure:

aggr(if(Sum(Value)>=above(sum(Value)),sum(Value),0),Seller,Month)

 

sellers who were worse this month then previous month:

Create a bar chart:

as dimensions:

Month

Seller 

as a measure:

aggr(if(Sum(Value)<above(sum(Value)),sum(Value),0),Seller,Month)

 

here's a result per analogy :

Capture.PNG