Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
adoteykwame
Contributor

IF statement to categorize..

Hi,

i'm trying to categorize the using an If statement.

IF (Amount <= 200,'<=500',IF(Amount >500<1001,'501-1000',IF(Amount >1000>2000'1001-2000',null()) )) as AmountSize;

Please help .Thanks

1 Solution

Accepted Solutions
billbois
New Contributor III

Re: IF statement to categorize..

I'm unable to test this at the moment, but I think it would be something like this:

IF (Amount <= 200, '<=500',

    IF(Amount >500 AND Amount <1001, '501-1000',

    IF(Amount >1000 AND Amount <2000, '1001-2000',

    null()))) as AmountSize;

Hope this comes close.

4 Replies
billbois
New Contributor III

Re: IF statement to categorize..

I'm unable to test this at the moment, but I think it would be something like this:

IF (Amount <= 200, '<=500',

    IF(Amount >500 AND Amount <1001, '501-1000',

    IF(Amount >1000 AND Amount <2000, '1001-2000',

    null()))) as AmountSize;

Hope this comes close.

Re: IF statement to categorize..

HI

IF (Amount <= 500, '<=500',

    IF(Amount >500 AND Amount <1001, '501-1000',

    IF(Amount <2000, '1001-2000',null()))) as AmountSize;

Hope it helps

adoteykwame
Contributor

Re: IF statement to categorize..

script line error

adoteykwame
Contributor

Re: IF statement to categorize..

sorry it worked,i had the same script in a different tab ,that's why i had the error

Thank you both

Community Browser