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

How to show multiple values of the If statement?

Hello,

I made a pivot table that shows the max amount of week sales of a shop that belongs to a branch. (rows - branches, columns - week numbers). Right now i made a function Max(aggr(Sum(Sales), week, branch, IdShop)). This shows sales numbers, but i want to show the IdShop, who made those max sales. How do i do that? I tried to do "If(Max(aggr(Sum(Sales), week, branch, IdShop)), IdShop), but it shows only one single shop, and i need to "replace" sales numbers to the IdShop, that made those sales.

Thank you.

1 Reply
marcus_sommer

Try an approach like this:

concat(aggr(Max(aggr(Sum(Sales), week, branch, IdShop)), IdShop), ', ', IdShop)

Maybe you need within these nested aggregation a set analysis {1} and/or a total and/or a Nodistinct statement.

- Marcus