Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help: If / Set / inline/ or something else? need to add type to numbers ranges

Hi,

I am struggling with this.

I got lets say (column A): around of 100.000  of ten digit numbers starting from 0000000000 and ending at 9999999999

what I need to do is to add type/clasification. lets say that all the numbers below 5000000000 should get a tag Region A and the numbers above 5000000000 should get the classification/type tag as Region B

and on top of that there are some bad quality numbers: all that are not ten digit numbers - thouse should get a tag n/a

anyone is genious enoough and can solve this puzzle?  Thanks in advance!

cant send the orignal but it more or less the same structure like that one atttached. I hope it helps and thanks! Message was edited by: romandahl

1 Solution

Accepted Solutions
nirav_bhimani
Partner - Specialist
Partner - Specialist

Hi,

Please find the attached File.

Regards,

Nirav Bhimani

View solution in original post

3 Replies
nirav_bhimani
Partner - Specialist
Partner - Specialist

Hi,

You can try this in the script

If(columnA>999999999 and columnA <=5000000000,'Region A', IF(columnA >5000000000,'REGION B','NA')) as Region,

Regards,

Nirav Bhimani

stevelord
Specialist
Specialist

Like this in script will work well:

if(BMI>=18.6 AND BMI<=24.9, Dual('Normal Weight (18.6-24.9)',1),

        if(BMI>0 AND BMI<18.6, Dual('At Risk, Underweight (<18.6)',3),

        if(BMI>24.9 AND BMI<1000, Dual('At Risk, Overweight/Obese (>24.9)',2)))) as rbBMI,

Just put your field names where I have BMI and rbBMI and your own # value ranges in there.

Update: also any # outside the above values will just be left as a null in the the new field created.  And the selection boxes for fields created by Dual If statements work better than ones for fields created by if statements.  I quit using regular if statements in my script for things I needed listboxes for.

nirav_bhimani
Partner - Specialist
Partner - Specialist

Hi,

Please find the attached File.

Regards,

Nirav Bhimani