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

If based sum on Customer level (aggr?)

Hi,

I'm running into an issue with an expression I am trying to complete.

So I have 2 expressions:

1: number of items

2: number of planned items

I would like to check whether my first expression is bigger than my second one and if that's the case, I would like to take the lowest value.


If I use an expression (=if(column(1) <= column(2), column(1), column(2)) on customer level my table looks fine, but the total should just take the values on customer level and sum those.


I've tried using Aggr(), but that's not working for me. Is there anyone that can help me?

The pivot table looks as follows with customer selected:

ProductCustomerNumber of itemsNumber of planned itemswished outputActual output
AA0600
AB2622
BA3633
CC8666
CD2622
CE5655
TotalTotal20361820

Thanks!

1 Reply
marcus_sommer

Try it with:

sum(aggr(rangemin(column(1), column(2)), Product, Customer))


- Marcus