Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

merge / join together values of age-group

In the load script I have an age group with the following values:

0 t/m 4
5 t/m 12
12 t/m 18
18 t/m 65
> 65

Now I want to have the opportunity to select 0 t/m 18 as one value .. Can I do this somehow in the load script? Maybe as another table with different values

0 t/m 18

> 18

1 Solution

Accepted Solutions
Not applicable
Author

Well, there would be 15 combinations of those values including one that would select all and 5 that would select only one. Do you want to give the user all possible combinations (like 5-18, 18-65+, etc.)?

If the zero to 18 is a special case, then you could make that another field. Something like this in your load script:

CASE WHEN AGE_RANGE = '0 t/m 4' THEN '0 t/m 18'

WHEN AGE_RANGE = '5 t/m 12' THEN '0 t/m 18'

WHEN AGE_RANGE = '12 t/m 18' THEN '0 t/m 18'

ELSE '' END AS AGE_RANGE_U18

Something like that. You could also do it as a Y/N and name the field "Under 18?"

View solution in original post

3 Replies
Not applicable
Author

Well, there would be 15 combinations of those values including one that would select all and 5 that would select only one. Do you want to give the user all possible combinations (like 5-18, 18-65+, etc.)?

If the zero to 18 is a special case, then you could make that another field. Something like this in your load script:

CASE WHEN AGE_RANGE = '0 t/m 4' THEN '0 t/m 18'

WHEN AGE_RANGE = '5 t/m 12' THEN '0 t/m 18'

WHEN AGE_RANGE = '12 t/m 18' THEN '0 t/m 18'

ELSE '' END AS AGE_RANGE_U18

Something like that. You could also do it as a Y/N and name the field "Under 18?"

Not applicable
Author

Thanks, works good!

yblake
Partner - Creator II
Partner - Creator II

you can try this

if (match(age_range,'0 t/m 4','5 t/m 12','12 t/m 18') > 0,'0 t/tm 18'',' > 18')

you may use it on load statements or as calculated dimensions.