Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Or And in set analysis

Hi Exterts,

Can you tell me , by default what we have in set anlysis. Is it OR or AND operatiion.

For example.

sum({<Region={'Asia','Europe'},Country={'India','US','UK'}>}Sales)

Here in above example , what will be the operation by default.

If we want to use OR or AND , how do we implement.

Please answer my 3 questions.

Advance thanks..

7 Replies
Not applicable
Author

default take OR operator represents by comma

Not applicable
Author

Thnaks for your quik response.

But can you give me few more information like...

if we want to perfom externally, how do we implement AND , OR operations. Can you modify the expression from my earlier post.

Not applicable
Author

in set analysis

+    Union (Returns the set of all records that belong tothe unioned sets)

-     Exclusion  (Returns records that belong to the first but not the other of the two set identifiers.)

*     Intersection (Returns records that belong to both of theset identifiers.)

/     Symmetric Difference (Returns a set that belongs to either, but not both of the set identifiers.)

Not applicable
Author

Updated code

Bydefault take OR---

sum({<Region={'Asia','Europe'},Country={'India','US','UK'}>}Sales)

for OR--

sum({<Region={'Asia'}> + <Region={'Europe'}> + <Country={'India','US','UK'}>}Sales)

for And


sum({<Region={'Asia'}> * <Region={'Europe'}> + <Country={'India','US','UK'}>}Sales)


saumyashah90
Specialist
Specialist

It takes Or Operation in set analysis by default if commas are used like in your example

Not applicable
Author

example--

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

An "OR" in set analysis is a union of two sets. You do a union with the "+" operator like so:

sum({<Year={2012}>+<Region={US,SE,DE,UK,FR}> Sales)

er_mohit
Master II
Master II

hiiii in set analysis condition it work as OR because the , separated which you ll put conditions are always act in or

but if you want AND then the expression is using by * puts a condition in it

sum({<Region={'Asia','Europe'},Country={'India','US','UK'}>}Sales)

moreover see the attached set analysis file  will help you alot