Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

or clause in set analysis

Hi all,

I'm wondering if it is possible to handle the following issue in a set analysis:

have the next data structure:

KEY| numericValue|  FIELD1 | FIELD2

I need to calculate a sum on a certain field (numericValue) under to conditions:

1) FIELD1 = 1 OR FIELD2= 2

at first I had only FIELD1 and I used a sum with a simple set analysis, not I have an OR clause and

I'm trying to find a solution, and don't know whether set analysis supports OR clause.

Regards,

Boris

6 Replies
MK_QSL
MVP
MVP

SUM({<FIELD1 = {1}> + <FIELD2 = {2}>}Sales)

sushil353
Master II
Master II

Hi Try this:

sum({<Field={1}>+<Field={2}>} values)

HTH

sushil

Not applicable
Author

+ means OR?

what about AND then? is it represented by a comma?

can you give me an example for this type of set analysis:

condition1 AND (condition2 OR condition3)

anbu1984
Master III
Master III

FIELD1 = 1 And FIELD2 = 2

SUM({<FIELD1 = {1},FIELD2 = {2}>}Sales)

MK_QSL
MVP
MVP

=SUM({<Region = {'R1','R3'}>+<Country = {'Holand'}>}Sales)

The above will give you SUM(Sales) for Region = either R1 and R3 or Country = Holand...

So,

SUM({<Region = {'R1','R3'}>}Sales) + SUM({<Country = {'Holand'}>}Sales)

anbu1984
Master III
Master III

condition1 AND (condition2 OR condition3) = (cond1 And cond2) Or (cond1 And cond3)


SUM({<FIELD1 = {1},FIELD2 = {2}> + <FIELD1 = {1},FIELD3 = {3}>}Sales)