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

MAX COUNT and its value in PIVOT Table

Hi ,

I facing an issue to know the value which has max count, let me explain you by example.

Input:

 

MonthCost
Jan10
Jan11
Jan11
Jan13
Jan12
Feb11
Feb12
Feb12
Feb12
Feb13

Output :

 

Monthmax( aggr( count(Cost),Month,Cost))Max Cost Value
Jan211
Feb312

I can able to achieve the max count but I am facing an Issue finding the max cost value. Can you please let me know how can I achive this? Thank in advance.

Regards,

Siva

15 Replies
uacg0009
Partner - Specialist
Partner - Specialist

You're welcome, hope it won't affect your performance and works fine.

If there is no problem, please help to closed this questions.

And if any problem please tell me.

Thanks.

Aiolos

Anonymous
Not applicable

Zhao, could u pls explain - sign in front aggr

uacg0009
Partner - Specialist
Partner - Specialist

Sorry, what's the meaning of "sign in front aggr" ?

Do you mean the function "aggr" ?

Aggr is just a group by, it's not too hard. It just group by Month and Cost to calculate the count(cost).

Thanks.

Aiolos

Anonymous
Not applicable

minus sign before aggr function..

uacg0009
Partner - Specialist
Partner - Specialist

oops...sorry for that,

because of the firstsortedvalue, I use rank = 1, so the sort is from minus to max. But I want to get the max value, so I use the minus sign.

Anonymous
Not applicable

tnx  a lot....