Announcements
cancel
Showing results for
Did you mean:
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

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
Contributor III

Hi

May be something like this

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

4 Replies
Contributor III

Hi

May be something like this

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

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

Community Browser