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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
bilionut
Contributor III
Contributor III

sum in Set Analysis

Hi,

I have to sum all the values with Satus = 'Active' and those with Status='Sold' and IDFact not NULL

LOAD *

Inline [

Dim,IDFact,Value,Status

AA,1,10,Active

BB,,20,Active

CC,,30,Sold

DD,4,40,Sold

];

How do I do that in Set Analysis?

Tanks,

1 Solution

Accepted Solutions
vhespinog
Contributor III
Contributor III

Hi

May be something like this

=sum({$<Status = {'Active','Sold'}, idFact ={"=len(trim(IDFact))>0"} >}Value)

View solution in original post

4 Replies
vhespinog
Contributor III
Contributor III

Hi

May be something like this

=sum({$<Status = {'Active','Sold'}, idFact ={"=len(trim(IDFact))>0"} >}Value)

vinieme12
Champion III
Champion III

References

Set Analysis: syntaxes, examples

https://www.analyticsvidhya.com/blog/2014/01/set-analysis-qlikview/

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
bilionut
Contributor III
Contributor III
Author

Your expression brings all the values. I need to exclude only those values that have Status=Sold and IDfact null

The condition must be something like that:

(Status = {'Active'} ) or (Status='Sold' and IDFact not NULL)


In the end I found  that this works

sum({<IDFact={"=len(trim(IDFact))>0"}> * <Status={'Sold'}>+<Status={'Active'}>} Value)

Anonymous
Not applicable

Hi,

It is possible to be something like below

sum({$<Status = {'Active','Sold'}, idFact ={"=len(trim(IDFact))>0 and len(trim(IDFact))<5"} >}Value)


Best Regards,

Louis