Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
capriconuser
Creator
Creator

Expression in qlikview

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')
)

but this expression did not working

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

and other condition is when policy exist in current year then those all policies should be new

Child policy parent policy   Year     Status
12                456         2017     renew
124              12           2018     lost
abc-12          -             2019      new
anx-1345        -             2019      new 

so how i modify expression according to these conditions

Labels (1)
5 Replies
m_woolf
Master II
Master II

If I'm reading your logic correctly, try:

if(Len([Parent Policy])=0 and UW_YEAR=Year(Today()) , 'new',
capriconuser
Creator
Creator
Author

oh sorry this is by mistake in question it is already  ' = ' sign.

 

and when i try this expression 

then data is like this where as that kind of record should be lost.. because there is no parent policy 

Child policy    parent policy          year             Status

123xc                  -                             2018               renew

 

so data should be like this 

 

Child policy    parent policy          year             Status

123xc                  -                             2018               lost

 

m_woolf
Master II
Master II

Your logic says:

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

Shouldn't that also be "=" 

capriconuser
Creator
Creator
Author

now i have a different question so how i delete this question because now this not relevant to issue