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

Calculate nbr of stores that increased sales

Hi!

Loading sales each month and I show (by trellis gauge) how each region is doing. Now I want to do the same but show stores.

However, the store are approx. 480 so the visual would be a mess.

So I though that I just count how many stores increased sales and how many that decreased and then I show that in a gauge on dashboard.

How to calculate how many increased sales this month compared to previous? Loading sales from excel each month.

store, date, amount

regards

thomas

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You need something like this:

Sum(Aggr(If(Sum({<Year = {"$(=Max(Year))"} Sales) > Sum{<Year = {"$(=Max(Year)-1)"} Sales), 1)), Store))

Assumes Year field, Store field for unique code or name of store and Sales field for the amount of Sales; change as required. Check brackets as I did not check this myself.

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

2 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You need something like this:

Sum(Aggr(If(Sum({<Year = {"$(=Max(Year))"} Sales) > Sum{<Year = {"$(=Max(Year)-1)"} Sales), 1)), Store))

Assumes Year field, Store field for unique code or name of store and Sales field for the amount of Sales; change as required. Check brackets as I did not check this myself.

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

The actual code:

=sum(if(Aggr(Sum({<PeriodCounter={$(#=max(PeriodCounter))}>} [Summa Insättning]),CLEARINGNUMMER)<Aggr(Sum({<PeriodCounter={$(#=max(PeriodCounter-1))}>} [Summa Insättning]),CLEARINGNUMMER),1,0))

And yes, I know that I'm checking if it's less and then set it to 1...