
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FirstSortedValue to find the last value.
I am using this expression to identify "the name of the State" that has "Maximum Contstituency":
=FirstSortedValue(State,(aggr(rank(count([Constituency-code])),[State-code])))
Now, when I want the reverse to find the name of the state that has "minimum Constituency", I use '-ve' sign:
=FirstSortedValue(State,-(aggr(rank(count([Constituency-code])),[State-code])))
It does not return any value. I am not sure where I am doing wrong with FirstSortedValue?
- Tags:
- firstsortedvalue

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, you can try with =FirstSortedValue(State,(aggr(rank(-count([Constituency-code])),[State-code])))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I implemented what you mentioned but it too did not return any value.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This?
=FirstSortedValue(State,(aggr(rank(count([Constituency-code])),[State-code])), count(distinct State))


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try ?
= FirstSortedValue(State, -Aggr(only(Count([Constituency-code])),[State-code], State))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are there more than one state where the Count([Constituency-code]) is the same? If that's true which State do you want? Randomly any or Concatenate the States to show all?
For Randomly one, you can try this:
- gives Max and +gives min
MaxCount
=FirstSortedValue(DISTINCT State, -Aggr(Count([Constituency-code]), [State-code], State))
MinCount
=FirstSortedValue(DISTINCT State, Aggr(Count([Constituency-code]), [State-code], State))
