Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Logical OR in QlikView?

Seems like a simple request, but also seems difficult to do.

Say you have 2 list boxes:

State          Season

User wants to see a Sum of some field where State = some value OR Season = some other value.  So for example, Sum number of storms where State = Florida OR Season = Spring.  I know how to hardcode these specific selections using set analysis, but how can I allow the users to rapidly qlik different values?

1 Solution

Accepted Solutions

Re: Logical OR in QlikView?

Attached is an example showing what Gysbert suggested. I've put the two listboxes in different states so the selections don't interfere with one another.

-Rob

7 Replies

Re: Logical OR in QlikView?

You can't use this with just listboxes. A selection in one field may contradict with a selection in another field. In that case the selections in the other field would be cleared. If you have QV11 you can use alternate states for the different listboxes so the selections don't interfere with each other. This can be confusing for the user though if you don't make clear exactly how the setup works. You can use the alternate states in set analysis expressions. You can also try using input boxes with variables and use the variables in the set analysis expression.

The kind of set analysis expression for the logical OR looks like sum({<State={'some value'}> + <Season={'some other value'}>} Value). The + adds the two sets together.


talk is cheap, supply exceeds demand

Re: Logical OR in QlikView?

Attached is an example showing what Gysbert suggested. I've put the two listboxes in different states so the selections don't interfere with one another.

-Rob

Not applicable

Re: Logical OR in QlikView?

Thank you, both of you.  I had a feeling it would have to be done some way like this.  Now I'm wondering if there can be any easy way to fast swap between AND and OR.  A switch of some sort to dynamically change the "> + <" part of the set analysis with ", ".  Although if there were 5 listboxes, they may want to use something like (A OR B) AND (C OR D) AND E, but at that point, the business user may have to learn set analysis.

Re: Logical OR in QlikView?

That's an intriguing idea. See attached sample. I believe the set operator in this case will be "*", not ",".

-Rob

MVP
MVP

Re: Logical OR in QlikView?

There are examples and discussion on this topic over on this thread also: http://community.qlik.com/docs/DOC-5113

Use of multiple states certainly seems like a good way to de-couple selections from the rest of data model, and Set Analysis provides a neat mechanism for pulling things back together again.

-Steve

barryharmsen
Contributor II

Re: Logical OR in QlikView?

I created a solution that doesn't use alternate states, just set analysis. You can find more information, including the full, reusable expression and a sample application, here: Or-mode selections in QlikView The Qlik Fix!

admin1
New Contributor III

Re: Logical OR in QlikView?

Barry,

Could you please send me the example QVW for the same. I was unable to implement the solution specified above.

Community Browser