Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jelindbe
Partner
Partner

Strange results from where clause

I want to extract certain years and certain age groups.

This code works to extract the age groups (ages 0-5 years):

where Alder_1agr = '5 år' or Alder_1agr = '4 år' or Alder_1agr = '3 år' or Alder_1agr = '2 år' or Alder_1agr = '1 år' or Alder_1agr = '0 år';


And this code works to extract the years I want:

where INTAAR > 2014;


But when I combine like this:

where Alder_1agr = '5 år' or Alder_1agr = '4 år' or Alder_1agr = '3 år' or Alder_1agr = '2 år' or Alder_1agr = '1 år' or Alder_1agr = '0 år'

and INTAAR > 2014;

.....the result I get is an extraction of age groups but the extraction of years dos not work (I get all the years).

I cannot figure out why.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try adding some parentheses so the conditions are grouped together properly:

where (Alder_1agr = '5 år' or Alder_1agr = '4 år' or Alder_1agr = '3 år' or Alder_1agr = '2 år' or Alder_1agr = '1 år' or Alder_1agr = '0 år')

and INTAAR > 2014;


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Try adding some parentheses so the conditions are grouped together properly:

where (Alder_1agr = '5 år' or Alder_1agr = '4 år' or Alder_1agr = '3 år' or Alder_1agr = '2 år' or Alder_1agr = '1 år' or Alder_1agr = '0 år')

and INTAAR > 2014;


talk is cheap, supply exceeds demand

View solution in original post

jelindbe
Partner
Partner
Author

Thank you! (How silly of me.)