Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
tomhovens
Contributor II
Contributor II

FirstSortedValue multiple dates

Hi All,

I want to create a function to calculate the days with the highest occupancy. Till now I have

FirstSortedValue(Datum,-Aggr(sum(Occupancy),Contract)). But when there are mutliple dates with the highest occupancy this function doesn't work. How to solve this?

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

FirstSortedValue(Distinct Datum,-Aggr(sum(Occupancy),Contract))

View solution in original post

13 Replies
MK_QSL
MVP
MVP

FirstSortedValue(Distinct Datum,-Aggr(sum(Occupancy),Contract))

trdandamudi
Master II
Master II

Your expression looks good just replace

Datum

With

Distinct Datum

tomhovens
Contributor II
Contributor II
Author

Hi,

Thanks for the quick answers but.....

Distinct Datum.png

sunny_talwar

That is just an error shown by the expression editor. Click ok and you should be able to see the result.

tomhovens
Contributor II
Contributor II
Author

you are correct, thanks for helping

Kushal_Chawda

This is just to scare you, but it works. QlikView sometimes play with us.

MK_QSL
MVP
MVP

@tomhovens

Just curious to know.. What's the reason for not selecting my answer as correct !!!!

sunny_talwar

Happens to me all the time

MK_QSL
MVP
MVP

My answer was 2 mins earlier than selected answer...

I can understand if the answer was something different than my one.!!!

It's OK.. We shouldn't try to understand everyone here... Just try our best to help them out...!!