Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

maxsugak
New 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

3 Replies
pradosh_thakur
Honored Contributor II

Re: Monthly comparison showing best and worst

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.
Highlighted
maxsugak
New Contributor

Re: Monthly comparison showing best and worst

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

Re: Monthly comparison showing best and worst

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