Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
capriconuser
Creator
Creator

"New " status according to year

i am trying to get status "new" according to this condition 

Parent PolicyFrom DateTo DateUW_YEARstatus
MMI/85441-Jun-191-Jun-182019 

 

when policy did not complete 1 year and came first time then this should be considered as "new".Year  based on current year

and year came from "from date" and year which is in "UW Year" should be current year 

 

i tried this 

 

For New :

if(POLICY_NO=Previous(POLICY_NO),null,
IF(Policy_Effective_Year=year(Today()) AND UW_YEAR=YEAR(TODAY())) as Status

i want to do this in script .. not in experssion .. so i want "New" keyword in status column ..

but this shows an error 

 

 

Aney help

 

12 Replies
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Try this:

if((POLICY_NO<>peek(POLICY_NO) and
Policy_Effective_Year=year(Today()) AND UW_YEAR=YEAR(TODAY()),

     'NEW',null()) as Status

capriconuser
Creator
Creator
Author

hi..

Child PolicyParent PolicyFrom DateTo DateUW_YEARmonth diferenceNew this is want I want
     -  
P/01/CPE/2019/00014P/01/CPE/2018/0000301-03-201929-02-2020201911NEWNew
P/01/CPE/2019/00014P/01/CPE/2018/0000310-06-201929-02-202020198NEWRenew
P/01/CPE/2019/00014P/01/CPE/2018/0000310-07-201929-02-202020197NEWRenew
P/01/CPE/2019/00014P/01/CPE/2018/0000329-07-201929-02-202020197NEWRenew
P/01/CPE/2019/00014P/01/CPE/2018/0000307-08-201929-02-202020196NEWRenew

 

there is a condition  that if there is same policies then the min from date record should be "new" because this policies came first time and other policies which have same number should be as "renew" as you see in above table.

there is same policy but different from date.. means this policy renew again on 10-6-2019 .. and if last policy did not find in current year then this should be consider as "lost".. but in that case this policy is available in 2019 so this should be as "Renew" if not available in 2019 then should be as "Lost"

 

how i modify your expression 

capriconuser
Creator
Creator
Author

Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Do you have a sample app?

capriconuser
Creator
Creator
Author

this is the link of qvd file

https://jmp.sh/v/3r84DjYgcYYf29YsM4nc

StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

have you already ordered data by child policy, parent policy and from date before using the expression?

Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Try this qvw:

clipboard_image_0.png

 

capriconuser
Creator
Creator
Author

hi @Arthur_Fong 

i face issue on renew .. 

like in this data ..  status should not be lost.. because in "lost" case this is depend upon "to date" ..in lost case todate must be in previous year.... so when "to date" (year) is previous year then should be lost other wise renew when child policy is present .

 

i tried this 

 

 

if((Policy_Effective_Year=Year(Today()) and 
UW_YEAR=Year(Today()) AND Month_Difference < 12),'NEW',
If((Len(OLD_POLICY_NUMBER)>0 AND Month_Difference < 12 AND UW_YEAR<YEAR(TODAY())), 'RENEW','LOST' )) AS STATUS

 

 

 

Child PolicyParent PolicyFrom DateminDateTo DateUW_YEARSTATUSmonth difference
       -
P/01/EWI/2018/001-15-07-2018-14-12-20232018LOST65
P/01/EWI/2018/001-15-07-2018-14-12-20232018LOST65
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Can you please reupload your qvd file with this record?