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

SET Analysis With Aggr(),Count(),Max()

Hi All,

Kindly help me out in the below scenario,

I am Having the ID Column in Straight table and I need to use the Expression with Set analysis With all Three Function(  Aggr(),Count(),Max() ) and what will be resultant output.

I have tried the below Script but not Working.i know my script is wrong,

=Aggr(Count(iD),(max({<ID>}id)))

ID  Set Expression()

5

10

15

20

40

do the needful!

stalwar1marcowedelmarcus_sommerdevarasu07jonvitalepradosh_thakur

13 Replies
Anil_Babu_Samineni

May be this?

Max(Aggr(Count(ID), id))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

hi anil,

it need to be in Set analysis

Anil_Babu_Samineni

This is also called set analysis..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

hi the Scenario is need to have the Aggr() function  in first

Anil_Babu_Samineni

Not sure your business , May be helps When should the Aggr() function NOT be used?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Hi,

it is not up to the Requirement this Scenario was faced in the Interview so i post to get the clarification how  we can achieve it

Thanks,

Anil_Babu_Samineni

You may ask Interviewer exactly what you are trying to get. Can you make it as example as we have rights if we are not understand there manner.

So, If you want something please free to make example and result set needed..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
devarasu07
Master II
Master II

Hi,

Would be able to share your expected output in excel format? may be u can try like below,

Method 1:

=FirstSortedValue(<Dimension>, -Aggr(Count(ID), <Dimension>)) //FirstSortedValue with "-" will return the max value of the dimension

Method 2:

count({<ID={"=Aggr(max(ID),ID)"}>}ID)

Method 3:

=max( aggr( count(ID),<Dimension> ))

example, <Dimension> is ID then u can write like below

Max( aggr ( Count(ID) , ID) )

also u can check this article,

Set Analysis in the Aggr function

https://www.analyticsvidhya.com/blog/2014/02/aggr/

Regards,

Deva

Anonymous
Not applicable
Author

Hi,

it is not up to the Requirement this Scenario was faced in the Interview so i post to get the clarification how  we can achieve it

they asked me u have ID Column

And Values are 10,20,30,40

in set analysis write the Expression within aggr() function with count(id)and Max(id)

and what will be output

So i didn't get that so only i have posted to get the clarification on this scenario

Thanks,