Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
FLASH SALE: Save $500! Use code FLASH2026 at checkout until Feb 14th at 11:59PM ET. Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Assign value based on count

I have 3 dimensions: Accounts Locations Products An Account has multiple Locations, each with varying numbers of Products. I would like to flag the Location at each Account with the highest number of Products with "Primary".  Every other Location per Account would have an alternate flag "Secondary" Any ideas?

Labels (1)
3 Replies
sinanozdemir
Specialist III
Specialist III

Hi Jonathan,

I don't know your data so I am just guessing that you have numbers in Products dimension. If so, you can use Max(Total <Accounts> Products) function:

Capture.PNG

Hope this helps.

Anonymous
Not applicable
Author

That is very helpful and close but not quite.  I think the issue is products are individual records rather than just a number on a record. 

Capture_2.PNG

sunny_talwar

May be this?

=If(Count(Product) = Max(TOTAL <Accounts, Location> Aggr(Count(Product), Accounts, Location, Product)), 'Primary Location', 'Secondary Location')

Capture.PNG