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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Nested Set Analysis Help

Aggr(Rank(Sum({<AGENT_LAST_NAME>} UNITS)), {<LEAD_SOURCE-={'DAT'}>} AGENT_LAST_NAME)

THis is an expression designed to provide the agents RANK in new business only, excluding database(existing customers).

the aggr formula works independently, but when I add the second set analysis to tell qlik to exclude the units that are "dat", it gives me no result.

what did I do wrong?

thank you

1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Try this

Aggr(Rank(Sum({<AGENT_LAST_NAME, LEAD_SOURCE-={'DAT'}>} UNITS)), AGENT_LAST_NAME)

View solution in original post

7 Replies
jothimala
Partner - Contributor II
Partner - Contributor II

Hi

Actually the basic syntax of aggr() is Aggr(Expression, Dimension)

In your script the expression part is correct, the dimension part is not right.

Try putting {<LEAD_SOURCE-={'DAT'}>} AGENT_LAST_NAME within any aggregate function ,because the set expressions can be used only within aggregate function only


Else you exclude LEAD_SOURCE-={'DAT'} in the expression part itself

Anonymous
Not applicable
Author

thank you

could actually write the expression as you would do it? I am quick new still and just venturing into this aggr area with nested set analysis. if you write it I will then know for the future.

thank you

sunilkumarqv
Specialist II
Specialist II

Hello Kenneth ,

Can you try using below and let us know

Aggr(Rank(Sum({<AGENT_LAST_NAME,LEAD_SOURCE-={'DAT'}>} UNITS)) AGENT_LAST_NAME)

BalaBhaskar_Qlik
Master
Master

May be this:

Example: Aggr(Rank(Sum(Sales)),Product,SkuCode)

From the example:

Aggr(Rank(Sum({<AGENT_LAST_NAME=>} UNITS)), ({<LEAD_SOURCE-={'DAT'}>}AGENT_LAST_NAME), AGENT_LAST_NAME)

Or

Aggr(Rank(Sum({<AGENT_LAST_NAME=, LEAD_SOURCE=e({$<LEAD_SOURCE = {'DAT'}>}Units)>}Units)) ,AGENT_LAST_NAME)

sunny_talwar
MVP
MVP

Try this

Aggr(Rank(Sum({<AGENT_LAST_NAME, LEAD_SOURCE-={'DAT'}>} UNITS)), AGENT_LAST_NAME)

Anonymous
Not applicable
Author

worked perfectly

tried exact same thing with rank in sales(package ID) and didnt work.

can you advise why?thanks

Aggr(Rank(count(distinct({<AGENT_LAST_NAME,LEAD_SOURCE-={'DAT','DAO','KHA'}>} PACKAGE_ID))), AGENT_LAST_NAME)

sunny_talwar
MVP
MVP

Try this

Aggr(Rank(Count(DISTINCT {<AGENT_LAST_NAME, LEAD_SOURCE -= {'DAT', 'DAO', 'KHA'}>} PACKAGE_ID)), AGENT_LAST_NAME)