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

conditional sum

Hi,

I am trying to do a conditional sum.

I have 1000 rows of information in total.

and only 500 of them meets the criteria to be "real asset"

so what i want to do is to show the pie chart which has only "real asset" as the foundation and show how the "real asset" is divided into 3 categories.

so what I was thinking was

put the category as a dimension and

use a conditional sum in expression.

the conditional sum could be

if( #### = 'abc', 'def', 'ghi' and @@@@ = 'N' and $$$$ = '123', '456'), sum(count_row)

and I am not sure how to make use of conditional function. I can't get it to work.

help me please!!

1 Solution

Accepted Solutions
sunny_talwar

May be like this:

Sum({<#### = {'abc', 'def', 'ghi'}, @@@@ = {'N'}, $$$$ = {'123', '456'}>} count_row)

View solution in original post

6 Replies
sunny_talwar

May be like this:

Sum({<#### = {'abc', 'def', 'ghi'}, @@@@ = {'N'}, $$$$ = {'123', '456'}>} count_row)

Not applicable
Author

Thank you Sunny this works!

Not applicable
Author

Hi sunny,

I have one follow up question. I want to add one condition. I want the condition to be $$$$ = Nullvalue.  but I tried few things but I could not filter for columns with null values.

Can you help me with this?

Thanks!

sunny_talwar

May be this:

Sum({<#### = {'abc', 'def', 'ghi'}, @@@@ = {'N'}, $$$$ -= {'*'}>} count_row)

Not applicable
Author

wow you used minus sign in from of equal sign.

the expression does not show error but once I apply it, it does not show any change.

I want to filter for the rows that have NULL for the column and my table obviously says NULL. I don't understand why this is not working in QV. all the other filters are working as you have explained but this null thing is not. hmmmmmmmm

is there any other possible way?

Thank you very much for your response!!

sunny_talwar

May be try this:

Sum({<#### = {'abc', 'def', 'ghi'}, @@@@ = {'N'}, count_row = e({<$$$$ = {'*'}>})>} count_row)