
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"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 ?
- Tags:
- new_to_qlikview

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The"+"-sign is used for OR in set analysis

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this,
if(sum(DISTINCT {<column_A={'>0'}>}quantity) or sum(DISTINCT {<column_B={'>0'}>}quantity),SUM(distinct (quantity)))
it works in my case..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
(deleted my question and added this reply instead)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this:
=Count({$<column_A={'>0'}> + <column_B={'>0'}>}DISTINCT quantity)
