Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Incorporate new scenario in set analysis statement

 

If(len(trim([K04 Date]))<>0 ,
(
if(day([K04 Date])<=15,date(monthstart(addmonths([K04 Date],1))),date(monthstart(addmonths([K04 Date],2))))),
if([LM Workout Status Act]='IN TRIAL',[K04 Date],
If(len(trim([367]))<>0 ,
(
if(day([367])<=15,date(monthstart(addmonths([367],1))),date(monthstart(addmonths([367],2))))),
if([LM Workout Status Act]='IN TRIAL',[367]
))))
as [trial1_due_dt] ,

 

The above statement says that if a K04 date is greater than 0 then

 

            If that K04 date occurred <=15 days into the month show the first day of the next month else

 

            If that same K04 date occurred >15 days into the month increment it by 2 months

 

We do the same for the 367 date.  Here is my question.

 

I now need to add in a new scenario.  If a loan_type=’CRM’ and K04 Date >=21 days then add 3 months and show the first day of that month, otherwise we keep the same logic as presented.  How would I incorporate this new scenario in the above sample logic

 

1 Reply
Gysbert_Wassenaar

Put your new condition in an if statement around your current expression with your second expression as the false branch of the if statement.

IF( ...new conditions here.... , ...new expression here... ,

If(len(trim([K04 Date]))<>0 ,
(
if(day([K04 Date])<=15,date(monthstart(addmonths([K04 Date],1))),date(monthstart(addmonths([K04 Date],2))))),
if([LM Workout Status Act]='IN TRIAL',[K04 Date],
If(len(trim([367]))<>0 ,
(
if(day([367])<=15,date(monthstart(addmonths([367],1))),date(monthstart(addmonths([367],2))))),
if([LM Workout Status Act]='IN TRIAL',[367]
)))))
as [trial1_due_dt]


talk is cheap, supply exceeds demand