Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
capriconuser
Creator
Creator

Expression according to multiple conditions

This is the expression what i have

 if(Len([Parent Policy])=0 and UW_YEAR<Year(Today()) , 'new',
if(UW_YEAR<Year(Today()) and Len([Parent Policy])>0 , 'lost', 'renew')
)

now i am going to modify this expression  according to below conditions 

data is like

Child_policy parent_policy  from_date    to_Date      Year   Month_Difference Status
12                -          10-7-2019   30-6-2020    2019     1                 Lost
12 - 01-8-2019 30-6-2020 2019 1 Lost
12 - 01-8-2019 30-6-2020 2019 1 Lost
12 - 09-6-2019 08-6-2020 2019 12 Lost

this is expression 

if(Len([Parent Policy])=0 and UW_YEAR=Year(Today()) , 'new',
if(UW_YEAR<Year(Today()) and Len([Parent Policy])>0 , 'lost', 'renew')
)

 

here i want if from_date and t0_date month difference is below than 12 months then this should be new and if this is above 12 months then status should be lost .. 

and with that i want to keep these condition 

 

if data is like

Child policy parent policy Year   Status
12                -         2018   Lost

this means that this child policy not exist in current year (2019) and also dont have parent policy (parent policy means this policy not coming from previous year like 2017, 2016 etc ) so this should be lost

if this policy coming from previous year and parent policy is exist then status is renew but if this policy not exist in current year then last record should be lost

Child policy parent policy   Year   Status
12                456         2017   renew
124              12           2018   lost

 

0 Replies