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

Problem with SET ANALYSIS

Hi Community,

Please i want to hear something on SET ANALYSIS.

When you write a SET ANALYSIS statement as SUM({$<Annee={'2010'}, NumCpt4={'4621'}>}MontantDebit)

What happens if the set on which to apply the aggregation SUM is empty?

Thanks for your help..


5 Replies
Not applicable
Author

Hello

I think you must use " in stead of '

Like this:

SUM({$<Annee={"2010"}, NumCpt4={"4621"}>}MontantDebit)

If the calculation is empty I believe it returns a 0

regards, Jesper

magavi_framsteg
Partner - Creator III
Partner - Creator III

Hello Yimen.

What will happen is the exact same thing as would happen if you would have done the selections manually.

Ie.
- Select 2010 from field Annee
- Select 4621 from field NumCpt4
- Calculate SUM of MontantDebit

Not applicable
Author

That's what I thought but it does not return me 0.

I don't what i will do???

Not applicable
Author

In fact, in my table, there are no lines which NumCpt4 = "4621". Normally, the result should be 0. But this is not the case.
What to do to remedy it?

magavi_framsteg
Partner - Creator III
Partner - Creator III

What does it return you?

You can always use if-statements preceding SUM.

if (SUM({ set } ) > 0, do this if greater than zero, do that if not greater than zero)