Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

“OR” selection between two fields.

The normal behavior of QV selections is that logical OR applies to selections in one field, and logical AND for selections between the fields. Using Presidents.qvd as example:
a) Selecting Democrat and Republican in the Party field returns Presidents who are Democrats OR Republicans.

b) Selecting States Texas and Iowa returns Presidents who're born in Texas OR Iowa.

c) Selecting Party=Whig and State=Virginia returns a list of Presidents who're Whigs AND born in Virginia.

Recently I got a requirement which should use logical OR between two fields. Using as example the data from the same Presidents application:
Selecting Party=Whig and State=Virginia returns a list of Presidents who're Whigs OR born in Virginia.

Obviously if you don't make a selection in both fields - the full list will be returned.

Take a look how I've resolved it. If there is a better solution, I'm certainly will consider it.

(The same description and the file is on "How to")

1 Reply
Not applicable
Author

I think there isnt any other solve . We have to divide table for this relational selections as you did.

Case a and b we selected from the same field from the same table (president table) . We selected democrat and repuclican in the party field Qv birng us rows that includes "democrat and repuclican" Logical means democrat or repuclican.

On Case C .. We selected from the different filed from the same table (pt) . We selected "Whig" from the party field and "Virginia" from the state field.Qv birng us which row or rows include "Whig" from the party field and "Virginia" from the state field on the same rows .

My conclusion is ; We couldnt make selections like that from the same table. Its just an opinion of course ... if is there any possibility I could be shocked Tongue Tied

Best Regards.