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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Issue in nested if

Hi,

Can someone please help me with this nested if condition in the script.

I want to categorize these days into four sub groups.

i.e., >10 , >31, >61, >91
  
I wrote the if condition but its failing in some cases.

if([Days Past Due] >91, '>91',
        if([Days Past Due] ,'>61',
           if([Days Past Due] ,'>31',
             if([Days Past Due] >10 ,'>10',null())))) as [Days Past Due Range]

Regards,

Sachin

11 Replies
ramoncova06
Partner - Specialist III
Partner - Specialist III

you are missing a couple of values in your if's

If([Days Past Due] >91, '>91',
        if([Days Past Due] >61,'>61',
           if([Days Past Due] > 31,'>31',
             if([Days Past Due] >10 ,'>10',null())))) as [Days Past Due Range]

Not applicable
Author

Ramon, sorry about the typo, but the requirement is, if the [Days Past Due] value is 32. It should come under the '>10' as well as '>31' bucket. Which won't happen as per the above if condition.

Qrishna
Master
Master

Try the script in the doc..

output:

Capture2.PNG

ramoncova06
Partner - Specialist III
Partner - Specialist III

so you want to create a second entry, one per each bucket ?

Not applicable
Author

Hi Chaitanya,

Where is the document attached.

Not applicable
Author

Yeah

Qrishna
Master
Master

its attached.

Capture1.PNG

Not applicable
Author

But the requirement is:

For ex when the value is 36 it should come under >10 as well as >31 bucket.

Not applicable
Author

But the requirement is:

For ex when the value is 36 it should come under >10 as well as >31 bucket.