Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with MAX

Hello,

I have an expression that shows me what the Max sales qty of a product was in a period of time.

max({$<[Barcode Stock] = >}aggr(sum({$<[Barcode Stock] = ,[Rolling Period Stock]={">=$(=vPeriodQuarterStartPast)<=$(=vRollingPeriod)"}>}[Qty Stock]),[Barcode Stock],[Rolling Period Stock]))

this works fine and returns the max qty of sales in the best period.....

what I want is an expression to show me which period the sale was in....

example:

PeriodSum of Qty

1

15
210
325
424
520
616

so my expression would tell me the max sales qty was 25, and i'm after an expression to tell me the period was 3.

Thanks,

Ben.

11 Replies
Not applicable
Author

Thanks,

This works a treat!!

Cheers,

Ben.

Not applicable
Author

Hi,

Slight issue though, with some of the products they have the same max qty in differentt periods so it is just returning an error...... any way i can add an if(expression = error,return latest max,return normal max)

Thanks,

ben.