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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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
MVP
MVP

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


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

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it

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
MVP
MVP

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


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

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
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