Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
mccook
Creator
Creator

Possible Aggr Function Help

Hi,

I have a table like below:

UserRole
GavinAudit
TimAudit
HarpsAudit
GavinPurchasing
Tim

Purchasing

TimPurchasing
DeanAudit
HarpsAudit

I want to display in a text box the number of Users who have more than one role. e.g. 2

I've been playing around with the aggr function and can't seem to get it to work (never used aggr before).

Cheers,


Dean

1 Solution

Accepted Solutions
maxgro
MVP
MVP

=sum(if(  aggr(count(distinct Role),User)>1, 1,0))

View solution in original post

8 Replies
MK_QSL
MVP
MVP

In your list box expression, use below

=IF(AGGR(COUNT(Role),User)>=2,User)

or

=IF(AGGR(COUNT(Distinct Role),User)>=2,User)

UPDATE : Please check enclosed file.

alexandros17
Partner - Champion III
Partner - Champion III

In your list box at the end of fields list there is "Expression" voice, select it and write

=if(Aggr(count(DISTINCT Role),User)>1, User, Null())

mccook
Creator
Creator
Author

Thanks,

Sorry, I ment text box.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can use this as expression for the the text box: =count({<User={'=count(distinct Role)>1'}>}distinct User)


talk is cheap, supply exceeds demand
mccook
Creator
Creator
Author

thanks,

Sorry I ment text box. Although that is very useful.

maxgro
MVP
MVP

=sum(if(  aggr(count(distinct Role),User)>1, 1,0))

MK_QSL
MVP
MVP

=Concat({<User = {"=COUNT(Distinct Role)>=2"}>}Distinct User,', ')

MK_QSL
MVP
MVP

=Concat({<User = {"=COUNT(Distinct Role)>=2"}>}Distinct User,', ')