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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis

How do I alter the following expression to use set analysis rather than an If-statement so that Bill-To Keys <> 1 do not return in the table?

If(Aggr({$<SOURCE = {'ORDER'}>} Count(DISTINCT [Document Counter]), %BILLTO_KEY)=1,Sum([Item Net Value (USD)]))

I have tried this ...

Sum({$<Aggr({$<SOURCE = {'ORDER'}>} Count(DISTINCT [Document Counter]), %BILLTO_KEY)={1}>} [Item Net Value (USD)])

but is does not work (see below).

Aggr.PNG

Thanks!

1 Solution

Accepted Solutions
ramoncova06
Partner - Specialist III
Partner - Specialist III

Sum({$<%BILLTO_KEY= {"=Aggr({$<SOURCE = {'ORDER'}>} Count(DISTINCT [Document Counter]), %BILLTO_KEY) <>1"}>} [Item Net Value (USD)])


I haven't tested this yet, though you need to use a search in your set analysis

View solution in original post

3 Replies
ramoncova06
Partner - Specialist III
Partner - Specialist III

Sum({$<%BILLTO_KEY= {"=Aggr({$<SOURCE = {'ORDER'}>} Count(DISTINCT [Document Counter]), %BILLTO_KEY) <>1"}>} [Item Net Value (USD)])


I haven't tested this yet, though you need to use a search in your set analysis

Not applicable
Author

Thank Ramon!

This did the opposite of what I was looking for but I switched the <> to = and it worked.

ramoncova06
Partner - Specialist III
Partner - Specialist III

I am glad it worked