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

Firstsorted value and its count in the same table

Hi Everyone,

Could someone please help me. As i am trying to get the firstsorted value for each dimensions and use the firstsorted value to count no of IDs.

For example:

CountryTop CityCustomers at Top CityTotal Customers
AustraliaSydney12002000
AmericaNew York14003000

I got Top City using First sorted value =

For example: FirstSortedValue(city_name, (-(Aggr(count(ID), Country, city_name))))

but i want to calculate the Customers at that City by using above expression, as i cant use If condition as we have many countries.

Thanks in advance.

Karthik

1 Reply
sunny_talwar

Try this:

Max(Aggr(Count(ID), Country, city_name)