Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
chewbacca23
Contributor
Contributor

Aggr in Set analysis

Hi all,

I'm tryind to display , for the #2 Product (based of sum of defect) , the name of the defect.

In a chart , I put "Name of defect" as dimenion and  this code as  Measure

sum({<ID={'=aggr(if(rank(sum(Count_DEFECT))=1,ID),ID)'}>}Count_DEFECT)

but seem not working.

When I use this code

sum({<ID={'CODE'}>}Count_DEFECT) 

It's work.

 

Can anybody help me?

 

Thank you..

1 Solution

Accepted Solutions
chewbacca23
Contributor
Contributor
Author

Thank you for the replys .

 

This solution works :

sum({<ID={'$(=aggr(if(rank(sum(Count_DEFECT))=1,ID),ID))'}>}Count_DEFECT)

As IRL, I need $  Smiley LOL


thanks a lot

View solution in original post

3 Replies
y_grynechko
Creator III
Creator III

Good Morning,

the way I loaded data: 

Capture2.PNG

Logic: 

Capture1.PNG

 

I hope I understood correctly what you want to accomplish. 

Zhandos_Shotan
Partner - Creator II
Partner - Creator II

Hi
Im wondering how this expression
sum({<ID={'=aggr(if(rank(sum(Count_DEFECT))=1,ID),ID)'}>}Count_DEFECT)
and sum({<ID={'CODE'}>}Count_DEFECT) 

will work differently. Both expressions search exact string values bcos placed in single quotes. 

Single quotes is for exact text values, double quotes "" for search expressions. Also in some cases we need to use $(=Expression).

Test aggr(if(rank(sum(Count_DEFECT))=1,ID),ID) in separate measure and

Try: sum({<ID={"=aggr(if(rank(sum(Count_DEFECT))=1,ID),ID)"}>}Count_DEFECT)

OR sum({<ID={'$(=aggr(if(rank(sum(Count_DEFECT))=1,ID),ID))'}>}Count_DEFECT)

 

Hope it helps

chewbacca23
Contributor
Contributor
Author

Thank you for the replys .

 

This solution works :

sum({<ID={'$(=aggr(if(rank(sum(Count_DEFECT))=1,ID),ID))'}>}Count_DEFECT)

As IRL, I need $  Smiley LOL


thanks a lot