Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Highlighted
bharatkishore
Contributor III

if condition

Hi all,

i have the below code in script

LOAD

     Key_EMS,

     If(Scenario_Type='Consumption', date(Max(Movement_Date),'YYYY-MM')) AS Install_Date,

     If(Scenario_Type='Defective',   date(Max(Movement_Date),'YYYY-MM')) AS Removal_Date

resident Master_Final

group by Key_EMS;


Now i need to pass one more condition in If(Scenario_Type='Defective',   date(Max(Movement_Date),'YYYY-MM')) as Removal_Date,


the condition what i need to pass is the below one


if(Removal_Date>Install_Date,'-',Removal_Date)


Can you please tell me how to achieve  it.


Thanks,

Bharat

1 Reply
michaelsikora
New Contributor III

Re: if condition

Bharat,

Try doing the following:

Table:

LOAD

     Key_EMS,

     If(Scenario_Type='Consumption', date(Max(Movement_Date),'YYYY-MM')) AS Install_Date,

     If(Scenario_Type='Defective',   date(Max(Movement_Date),'YYYY-MM')) AS Removal_Date

resident Master_Final

group by Key_EMS;


Left Join(Table)

LOAD

     Key_EMS,

     if(Removal_Date>Install_Date,'-',Removal_Date);

resident Table

Group BY Key_EMS;