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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
alan_grn
Creator II
Creator II

Set Analysis variance between 2 fields

I am trying to write set analysis for the following :

Sum Sales where Field1 > 0, Field2 > 0 and Field1- Field<0

I can get the first 2 pieces to work but when I try Field1-Field2={'<0'} I get no values

3 Replies
Anonymous
Not applicable

You can try Field1 ={"<$(Field2)"}, that is the same of Field1-Field2<0

alan_grn
Creator II
Creator II
Author

Thanks

Field1 ={"<$(Field2)"},


but I also need where Field1 > 0.


Sum({< Field1 ={">0"},Field2={">0"},Field1 ={">$(Field2)"}  >} Sales)

My code above works but I think that this give me where Field1 > 0 or > field2. How do I change this to and?

I need where Field1 > 0 and field1 >Field2

Anonymous
Not applicable

You can use intersection "*", for example:

Sum({< Field1 ={">0"}, Field2 ={">0"}>*<Field2 ={">0"},Field1 ={">$(Field2)"}>} Sales)

or something like this..