13 Replies Latest reply: May 12, 2016 5:53 AM by Manish Kachhia

# 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?

• ###### Re: FirstSortedValue multiple dates

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

• ###### Re: FirstSortedValue multiple dates

Your expression looks good just replace

Datum

With

Distinct Datum

• ###### Re: FirstSortedValue multiple dates

Hi,

Thanks for the quick answers but.....

• ###### 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.

• ###### Re: FirstSortedValue multiple dates

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

• ###### Re: FirstSortedValue multiple dates

you are correct, thanks for helping

• ###### Re: FirstSortedValue multiple dates

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

• ###### Re: FirstSortedValue multiple dates

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

• ###### Re: FirstSortedValue multiple dates

Neki kar aur dariya mein daal Manish Bhai

• ###### Re: FirstSortedValue multiple dates

I agree with you and this happens to me also... But it is a satisfaction that we get when we help others in need.

• ###### Re: FirstSortedValue multiple dates

Oops