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

Aggregation not influenced by filter

Hi,

I'm trying to calculate the contribution sales per store for each salesman.
I created   bar chart with this dimensions:

StoreID as group

and full name as bars.

my measure is:
aggr(sum(TotalPriceBeforVat),StoreHanut,SalesmanID)/sum( TOTAL <StoreHanut> TotalPriceBeforVat)

the issue is when I'm filtered on salesman -

I get this graph:

hadari_0-1714254218284.png

how can I divide by the store total sales that my salesman is part it's sales regardless my salesman selection?
I want to get the right percentage on the bar chart.

thanks!
 

 

Labels (3)
3 Replies
rubenmarin

Hi, using set analysis you can set a field name without assigning any value, this means to ignore selctions in that field, like:

aggr(sum(TotalPriceBeforVat),StoreHanut,SalesmanID)/sum( TOTAL <StoreHanut> {<SalesmanID,SalesmanName>} TotalPriceBeforVat)

SalesmanName is just an example on how to add different fields where the user can select and you want to ignore, in this case the divisor will ignore selctions on those 2 fields.

I'm not sure if you need the aggr here, maybe just:

sum(TotalPriceBeforVat)/sum( TOTAL <StoreHanut> {<SalesmanID,SalesmanName>} TotalPriceBeforVat)

hadari
Contributor III
Contributor III
Author

Hi!

Thanks for the replay.

but unfortunately now I get this on my graph when using this expression:

sum(TotalPriceBeforVat)/sum(total <StoreHanut> {<SalesmanID,FULL_NAME>}TotalPriceBeforVat)

the previous expression was not working.

this is what I'm getting on the bar chart:

hadari_0-1714285053047.png

when storehanut is my storeID.

It calculate it correctly but it still shows me all the other salesman names and I don't want it..

I want to show only the salesman selected in my filter on this bar chart.

 

how can I see only the salesman selected on the bar chart?

 

rubenmarin

Hi, in add-ons there is an option to hide values 0, but if want to see 0 when a salesman without sales is selected, this is not an option.

In that case maybe using calculated dimensions as:

StoreHanut -> =Aggr(If(Sum(TotalPriceBeforVat),StoreHanut),StoreHanut)

FULL_NAME -> =Aggr(If(Sum(TotalPriceBeforVat),FULL_NAME),FULL_NAME)