Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Urgent AGGR Help Needed.Please

Hi,

I am using following AGGR Function

MAX(Aggr(Sum(SALES_IM_QTY),DWH_SKU_REF_NO,DWH_IM_MONTH))

to find the amount of Sales in selected month and it gives me the result alright.

But if I want an expression which can also tell me the month it has taken in all the selected months i am not able to get it.

I tried

FirstSortedValue(DWH_IM_MONTH,-Aggr(Sum(SALES_IM_QTY),DWH_IM_MONTH, DWH_SKU_REF_NO))

but still not.

Please if any of you experts can Help me I will be very thankful to you.

7 Replies
sujeetsingh
Master III
Master III

You can use if statement to compare the month with sum of every month through set analysis.

avinashelite

Hi Muhammad,

Sorry i did not get your question can u please elaborate...or post your app

Anonymous
Not applicable
Author

Thanks for your interest mate,

Well What I am looking is to have Maximum selling month of the selected period.

DWH_IM_MONTH | SALES_IM_QTY

May         |        2300

June         |       5000

July          |        2000

Where June is a Max selling month.

Anonymous
Not applicable
Author

CAN YOU WRITE THE FORMULA PLEASE

simenkg
Specialist
Specialist

FirstSortedValue(DWH_IM_MONTH,-Sum(SALES_IM_QTY))

jaimeaguilar
Partner - Specialist II
Partner - Specialist II

Hi,

how about this:


Max(Aggr(Sum(SALES_IM_QTY), DWH_IM_MONTH. DWH_IM_YEAR))


I suppose there's a field called DWH_IM_YEAR in your data model or maybe if you have a field with the concatenation of Month and Year, then it would be better. The thing is that you need to aggregate your sales per month and per year (maybe also by DWH_SKU_REF_NO) and then you can get the max value,


regards

Anonymous
Not applicable
Author

THANKS BUT ACTUALLY THIS IS WHAT I WAS THINKING THE TABLE WILL BE CREATED IN AGGR FUNCTION.