Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
mharm
Contributor

aggr functionality to return a subset of results

I'm creating a table for my dashboard and only want to display BINS that are present and have someone in them. I did an aggr function and it's not working.  what am I doing wrong?

aggr(distinct {$<BINPresent = {1}>} {$<BINUnmapped={0}>}, BIN)

I understood this to return only the distinct BINS that have a binpresent of 1 and a binunmapped of 0.  am I using aggr incorrectly?  how can I return the BINs that I'm looking for?

3 Replies

Re: aggr functionality to return a subset of results

May be you need this (if you are using this as a dimension)

If(BINPresent = 1 and BINUnmapped = 0, Bin)

ogster1974
Honored Contributor II

Re: aggr functionality to return a subset of results

AGGR Function is there to group on a value not filter it.

COUNT(distinct {$<BINPresent = {1}, BINUnmapped={0}>} BIN) Would count the number of BIN that meat thats condition.

AGGR(COUNT(Distinct BIN), BINUnmapped) would return the number of BIN for each grouping of  BINUnmapped

I have this document on SET Analysis which is a really good reference guide,

Hope this helps

Andy

sasiparupudi1
Honored Contributor III

Re: aggr functionality to return a subset of results

Think Aggr as SQL Group By

Select

Count(BINS),

Store,

Rack,

Pallet

From MyTable

Group By Store,Rack,Pallet

Where BINPresent=1 and BINUnmapped=0

Set Analysis Count with Where Conditions

Count(

{<

BINPresent={1},

BINUnmapped={0}

>}

BIN)

Group by are the selected dimensions in the chart. Hth