Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
tomhovens
New 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
MVP
MVP

Re: FirstSortedValue multiple dates

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

13 Replies
MVP
MVP

Re: FirstSortedValue multiple dates

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

trdandamudi
Honored Contributor II

Re: FirstSortedValue multiple dates

Your expression looks good just replace

Datum

With

Distinct Datum

tomhovens
New Contributor II

Re: FirstSortedValue multiple dates

Hi,

Thanks for the quick answers but.....

Distinct Datum.png

Re: FirstSortedValue multiple dates

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

tomhovens
New Contributor II

Re: FirstSortedValue multiple dates

you are correct, thanks for helping

Re: FirstSortedValue multiple dates

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

MVP
MVP

Re: FirstSortedValue multiple dates

@tomhovens

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

Re: FirstSortedValue multiple dates

Happens to me all the time

MVP
MVP

Re: FirstSortedValue multiple dates

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...!!