Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Near
Contributor
Contributor

Date when Quantity is max as Set Analysis with aggr or firstshortvalue

Hi

i have an expression like this :

aggr(max(aggr(sum(NB_PLATEAUX),Date,UNITE)),UNITE)

And it's work : i have the max qty  (NB_PLATEAUX)  per day for the selection

Now i want the date when qty is max, with a set analysis but i don't know how write it...

Regards

Labels (1)
1 Reply
rubenmarin

Hi,I haven't tested but maybe:

Concat(Date(Aggr(If(sum(NB_PLATEAUX)=aggr(max(aggr(sum(NB_PLATEAUX),Date,UNITE)),UNITE), Date)

,Date)))

Concat is only in case there are more than one date with max sales.

If doesnt works you can also test adding a TOTAL:

Concat(Date(Aggr(If(sum(NB_PLATEAUX)=aggr(max(TOTAL aggr(sum(NB_PLATEAUX),Date,UNITE)),UNITE), Date)

,Date)))