Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
luca_bellotti
Contributor III
Contributor III

KPI selective sum

Hi everyone,

I'm a newbie to Qlik Sense Desktop.

I have an app and a KPI that sum sales (measure) of all the departments (dimension).

There are certain departments that ar null but have sales. I would like not to sum those sales.

Here's the table:

DepartmentShopMonthSales

A

a1jan10
Ba2jan10
Ba3jan10
nullb1jan10
Aa5jan10

My KPI object shows 50. How can I not consider the null department, and show 40?

Thanks to everyone.

1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

better if you replace null with string (ex. "n/a") in the script and use the expression as below :


Sum({$<[Department]-={"n/a"}>}Sales)

View solution in original post

6 Replies
luca_bellotti
Contributor III
Contributor III
Author

I've found a solution to my problem:

Sum({$<[Department]={"A"}>}Sales)+Sum({$<[Department]={"B"}>}Sales)

If somebody has a better solution feel free to share.

Thank you again.

Luca

agigliotti
Partner - Champion
Partner - Champion

better if you replace null with string (ex. "n/a") in the script and use the expression as below :


Sum({$<[Department]-={"n/a"}>}Sales)

Not applicable

Try this

Sum({$<[Department]-={"null"}>}Sales)

luca_bellotti
Contributor III
Contributor III
Author

Thank you Andrea, that's excatly what I was looking for.

Anonymous
Not applicable

sum({<Department={'*'}>}Sales) , this will only take non null values of department

Anonymous
Not applicable

sum({<Department={'*'}>}Sales) , this will only take non null values of department