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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Find largest dimension within a dimension

Hi all,

This is my first post so I'll try to keep it as detailed as possible. What I'm trying to do is to find the largest dimension within a dimension.
Let me try to explain.

I have a list of locations with different categories of people.

LocationsCategoryNumber of people

A

X532
AY2346
AZ642
BX75345
BY3452
BZ2457
CX624
CY445
CZ5683

What I want to do is create a list which can produce the top category in each location. eg.

LocationCategory
AY
BX
CZ


I have tried the following, but it always gives me the values for all locations A, B, and C combined:

=FirstSortedValue(Race,-Aggr(Count(DISTINCT SubID),Race))

Is there a way to do this?

Thanks all in advance!

LDK

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Include the location dimension in Aggr and try like:

=FirstSortedValue(Race,-Aggr(Count(DISTINCT SubID),Location, Race))

View solution in original post

5 Replies
tresesco
MVP
MVP

Include the location dimension in Aggr and try like:

=FirstSortedValue(Race,-Aggr(Count(DISTINCT SubID),Location, Race))

MK_QSL
MVP
MVP

See Attached...

er_mohit
Master II
Master II

Try this

FirstSortedValue(Category,-Aggr([Number of people],Locations,Category))

kumarnatarajan
Partner - Specialist
Partner - Specialist

Hi,

Try below script

Ex:

Aggr(NODISTINCT FirstSortedValue(Category, -[Number of people]),Locations)

Not applicable
Author

Hi tresesco,

Thank you so much this helps!

LDK