Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
12victory
Contributor
Contributor

Second max market share

Hi, I need to show the producers with the second largest share in each store. I'm trying to apply this expression:

max(sum({$<year={'2021'}>}[sales]) / sum(all <Customers>{$<year={'2021'}>}[sales]),2)

but Qlik doesn't allow to use MAX and SUM together.

I will be glad if you give advice on how best to write  expression for this aim

Thank you

12victory_0-1648651729630.png

 

Labels (4)
1 Solution

Accepted Solutions
brunobertels
Master
Master

hi 

may be 

max(

aggr(sum({$<year={'2021'}>}[sales]) / sum(all <Customers>{$<year={'2021'}>}[sales]),Producer, Store)

,2

)

 

View solution in original post

2 Replies
brunobertels
Master
Master

hi 

may be 

max(

aggr(sum({$<year={'2021'}>}[sales]) / sum(all <Customers>{$<year={'2021'}>}[sales]),Producer, Store)

,2

)

 

12victory
Contributor
Contributor
Author

Thanks a lot, it helped