Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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],
I think you are missing some comparisons in conditions:
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],
Last message sent to moderation:
Check your conditions, you are missing comparisons >61 resp >31 in second and third condition.
Hi,
Ssorry 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.
please create a complete input/output specification instead of opening new threads for the same question.
thanks
regards
Marco
like this?
or 4 different fields (>10 field, >31 field, etc...)?
d:
load * inline [
Days Past Due
10,
32,
62,
92
];
t:
load
[Days Past Due],
if([Days Past Due] > 91, '>91') as [Days Past Due Range]
resident d;
load
[Days Past Due],
if([Days Past Due] > 61, '>61') as [Days Past Due Range]
resident d;
load
[Days Past Due],
if([Days Past Due] > 31, '>31') as [Days Past Due Range]
resident d;
load
[Days Past Due],
if([Days Past Due] > 10, '>10') as [Days Past Due Range]
resident d;
load
[Days Past Due],
if([Days Past Due] <= 10, null()) as [Days Past Due Range]
resident d;
DROP Table d;