# New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

## "OR" operator in set analysis

Hi everybody,

I'm new to QV,

In a set analysis, I would like to sum according to conditions that are stocked in two different columns. Let's say column A and B have to be positive

• sum(DISTINCT {<column_A={'>0'}, column_B={'>0'}>} quantity) gives me the quantity if both conditions ar realized

• the * operator seems to work only for conditions within the same column, for instance : column_A={'b' * 'a'}

• sum(DISTINCT {<column_A={'>0'} or column_B={'>0'}>} quantity) seems not to work at all

I have the feeling that this is a very simple problem but looking for "set analysis or" in the forum doesn't help a lot as 'or' is not a very distinctive word...

Someone can give me a hint ?

5 Replies
Esteemed Contributor III

## "OR" operator in set analysis

The"+"-sign is used for OR in set analysis

Not applicable

## "OR" operator in set analysis

Try this,

if(sum(DISTINCT {<column_A={'>0'}>}quantity) or sum(DISTINCT {<column_B={'>0'}>}quantity),SUM(distinct (quantity)))

it works in my case..

Highlighted
Not applicable

## "OR" operator in set analysis

Had the same question, already posted that but then I saw this reply to a similar question in the forum:

http://community.qlik.com/message/51239#51239

Which implies that your solution would be:

sum(DISTINCT {<column_A={'>0'}> + <column_B={'>0'}>} quantity)

Not applicable

## Re: "OR" operator in set analysis

I agree with what’s being said. In Set analysis the logical operator “or” is written with a “+”. It works fine for me

The syntax is important, the + should be placed between the conditions of the set analysis : { www.coetsens.com

De : nessinot

Envoyé : mercredi 1 juin 2011 09:33

À : luc_fr_75

Objet : - Re: "OR" operator in set analysis

<http://community.qlik.com/index.jspa> QlikCommunity

Re: "OR" operator in set analysis

created by nessinot <http://community.qlik.com/people/nessinot> in New to QlikView - View the full discussion <http://community.qlik.com/message/120945#120945

Contributor

## Re: "OR" operator in set analysis

Try this:

=Count({\$<column_A={'>0'}> + <column_B={'>0'}>}DISTINCT quantity)