Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Alternative to using Set within an Aggr

I have a table with two dimensions and one expression: Client.Name, Industry, sum(Revenue)

I want to adjust my dimensions to only show clients in Industry 'A' who have <$1000 in revenue.  I currently do this using two dimensions and Suppress Null:

=if(aggr(sum(Revenue),Client.Name)<1000,Client.Name)

=if(Industry='A',Industry) [I hide this column]

Is it possible to do this using only a single dimension?  The trouble i'm having is that I would normally use set analysis to explicitly define Industry, but my understanding is you can't use set within the Aggr.

I ultimately want to create a table with one calculated dimension, Client.Name, defined as:  If Client's Revenue >=1000 OR [Client's Revenue < 1000 AND Industry = 'A'], then show Client.  I'm having a lot of difficulty getting this in a table.  Greatly appreciate any help.

12 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

As a Calculated Dimension I think it would be:

=aggr(only({<Customer={"=sum(Sales)>1000"}>+<Industry={A}>}Customer),Customer)

I think the <1000 test is unnecessary. They qualify either as being above 1000 or Industry A.

-Rob

Not applicable
Author

thanks so much, this worked

Not applicable
Author

i think my data set is just a little funky and not agreeing with it ... b/c as you said, your sample works ... thanks though, appreciate the help.