Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Chart with a conditional sum

Dear all,

I have a chart and I'm facing problem with conditional sum sintax.

In particular I have an expression that says

Sum (BALANCE_CTV2)

Now I need that the expression sum only the values where the filed ACC_TYPE_DESCRIPTION is equal

At Bank

or

Cash Pooling

or

Restricted

or

Short Term Investment

As alternative it could be more easy to say to sum if it is not equal to one of this two values:

Committed

or

Credit Facilities Drawn

If i try this sintax with just one of the values it works

=SUM({<ACC_TYPE_DESCRIPTION ={'At Bank'}>}BALANCE_CTV2)

but when i try to add the other values with the OR operator it doesn't work

Could someone tell me how is the sintax to include or exclude more then one value?

Thank you

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Commas are used for this functionality in set analysis.
=SUM({<ACC_TYPE_DESCRIPTION ={'At Bank','Cash Pooling','Restricted','Short Term Investment'}>}BALANCE_CTV2)


You could also use:

=SUM({<ACC_TYPE_DESCRIPTION -={'Committed','Credit Facilities Drawn'}>}BALANCE_CTV2)

The '-' (minus) sign is used for exclusion.

View solution in original post

11 Replies
Not applicable
Author

Maybe like this, you could use comma and use all the values

SUM({<ACC_TYPE_DESCRIPTION ={'At Bank','Cash Pooling'}>}BALANCE_CTV2)


--

amay


robert_mika
Master III
Master III

=SUM({<ACC_TYPE_DESCRIPTION ={'At Bank','Cash Pooling','Restricted','Short Term Investment'}>}BALANCE_CTV2)

Anonymous
Not applicable
Author

Commas are used for this functionality in set analysis.
=SUM({<ACC_TYPE_DESCRIPTION ={'At Bank','Cash Pooling','Restricted','Short Term Investment'}>}BALANCE_CTV2)


You could also use:

=SUM({<ACC_TYPE_DESCRIPTION -={'Committed','Credit Facilities Drawn'}>}BALANCE_CTV2)

The '-' (minus) sign is used for exclusion.

Not applicable
Author

Hi,

Try this expression.

SUM({<ACC_TYPE_DESCRIPTION ={'At Bank','Cash Pooling','Restricted','Short Term Investment'}>} BALANCE_CTV2)

sunny_talwar

You can use this as Utkarsh pointed out

=SUM({<ACC_TYPE_DESCRIPTION -={'Committed','Credit Facilities Drawn'}>}BALANCE_CTV2)


another variation of the same thing would be to use e() like this:


=SUM({<ACC_TYPE_DESCRIPTION =e({<ACC_TYPE_DESCRIPTION  = {'Committed','Credit Facilities Drawn'}>})>}BALANCE_CTV2) here the e is telling the expression to exclude the ACC_TYPE_DESCRIPTION where it is Committed or Credit Facilities Drawn.

HTH

Best,

Sunny

Not applicable
Author

Thank, It works perfectly!

Thanks a lot

Anonymous
Not applicable
Author

Great!

sunny_talwar

Mark Utkarsh's answer as correct so that the thread could be closed.

Best,

Sunny

Not applicable
Author

Dear all,

I've now an additional issue as my conditional SUM needs to operate on two different filed. In particular I need to sum combining this two condition

SUM({<myWeekday ={'Ven'}>}BALANCE_CTV2)

and

SUM({<ACC_TYPE_DESCRIPTION -={'Committed','Credit Facilities Drawn'}>}BALANCE_CTV2)


It means that the sum filed BALANCE_CTV2 must be only with the above two occurence.

Could you help with the sintax?

Thank you