Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
karthikoffi27se
Contributor III

Interval Function with IF condition

Spoiler
Hi All,

I have a field which is in DD:hh:mm format and I am trying to bucket into different categories as mentioned below 

 

LOAD *,
If(LOB = 'Medical',
IF(TAT_MOD>7,'>7 days',
IF(TAT_MOD>5 AND TAT_MOD<=7, '>5 days <=7 days',
IF(TAT_MOD>2 AND TAT_MOD<=5,'>2 days <=5 days',
IF(TAT_MOD>0 AND TAT_MOD<=1,'>0 days <=1 days',
If(TAT_MOD > 4/24 AND TAT_MOD<=2, '>4 hours days <=2 days', '<= 4 hours'))))),
IF(LOB = 'Life',
IF(TAT_MOD>7,'>7 days',
IF(TAT_MOD>5 AND TAT_MOD<=7, '>5 days <=7 days',
IF(TAT_MOD>3 AND TAT_MOD<=5,'>3 days <=5 days',
IF(TAT_MOD>0 AND TAT_MOD<=1,'>0 days <=1 days',
If(TAT_MOD > 4/24 AND TAT_MOD<=3, '>4 hours days <=3 days', '<= 4 hours'))))),
IF(LOB = 'Hala',
IF(TAT_MOD>7,'>7 days',
IF(TAT_MOD>5 AND TAT_MOD<=7, '>5 days <=7 days',
IF(TAT_MOD>3 AND TAT_MOD<=5,'>3 days <=5 days',
IF(TAT_MOD>0 AND TAT_MOD<=1,'>0 days <=1 days',
If(TAT_MOD > 4/24 AND TAT_MOD<=3, '>4 hours days <=3 days', '<= 4 hours'))))),
IF(LOB = 'Liabilities',
IF(TAT_MOD>7,'>7 days',
IF(TAT_MOD>5 AND TAT_MOD<=7, '>5 days <=7 days',
IF(TAT_MOD>3 AND TAT_MOD<=5,'>3 days <=5 days',
IF(TAT_MOD>0 AND TAT_MOD<=1,'>0 days <=1 days',
If(TAT_MOD > 4/24 AND TAT_MOD<=3, '>4 hours days <=3 days', '<= 4 hours'))))),
IF(LOB = 'PA',
IF(TAT_MOD>7,'>7 days',
IF(TAT_MOD>5 AND TAT_MOD<=7, '>5 days <=7 days',
IF(TAT_MOD>3 AND TAT_MOD<=5,'>3 days <=5 days',
IF(TAT_MOD>0 AND TAT_MOD<=1,'>0 days <=1 days',
If(TAT_MOD > 4/24 AND TAT_MOD<=3, '>4 hours days <=3 days', '<= 4 hours'))))),
IF(LOB = 'Travel',
IF(TAT_MOD>7,'>7 days',
IF(TAT_MOD>5 AND TAT_MOD<=7, '>5 days <=7 days',
IF(TAT_MOD>3 AND TAT_MOD<=5,'>3 days <=5 days',
IF(TAT_MOD>0 AND TAT_MOD<=1,'>0 days <=1 days',
If(TAT_MOD > 4/24 AND TAT_MOD<=3, '>4 hours days <=3 days', '<= 4 hours'))))))))))) AS TAT_MODIFIED,



;
LOAD *,

INTERVAL#(TAT,'DD:hh:mm') AS TAT_MOD
;

Filter.PNGNow my issue is TAT_MODIFIED is not picking up the conditional statement  >4 hours days <=3 days nor >4 hours days <=2 days  , it is starting show the values greater than equal to 1 day.

Any help is much appreciated. 

2 Replies
MVP & Luminary
MVP & Luminary

Re: Interval Function with IF condition

Please don't clutter this site with duplicate discussions: https://community.qlik.com/t5/New-to-QlikView/Interval-Function-with-IF-condition/m-p/1523840#M36735...


talk is cheap, supply exceeds demand
karthikoffi27se
Contributor III

Re: Interval Function with IF condition

Sorry, was posting in the different discussion group. Can you help me with the issue posted.