Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
Not applicable

FirstSortedValue and Count

Good day all

I am stuck!

What I wish to achieve is to return the date which is associated to the most number of orders for a day. Is firstsortedvalue the correct way to go? I have attached my app as well as a screenshot which adds more detail to my question:

Many thanks

ScottFSVCOUNT.png

8 Replies
Not applicable

Re: FirstSortedValue and Count

Do you really want the date or just order the date by the Count?

jolivares
Valued Contributor

Re: FirstSortedValue and Count

Try this:

=FirstSortedValue(Date,-Aggr(Count(OrderNo),Date))

Re: FirstSortedValue and Count

For the second part of the question, try this -> =FirstSortedValue(Date,-(Aggr(Count(OrderNo),Date)* 100000+Date))

MVP
MVP

Re: FirstSortedValue and Count

Part 2: Add a small value depending on date to distinguish between same Count:

=FirstSortedValue(Date,-Aggr(Count(OrderNo)+Date/1E6,Date))

Not applicable

Re: FirstSortedValue and Count

=only({<Date = {"=count(OrderNo)=Max(TOtal aggr(count(OrderNo),Date))"}>}Date) in a TextBox gives you exaktly the 15/01/2016

Not applicable

Re: FirstSortedValue and Count

Does not seem to work for some reason when I copied this expression

Not applicable

Re: FirstSortedValue and Count

I require the date.

Not applicable

Re: FirstSortedValue and Count

my qvw: