I am trying to achieve that when P NO is repeated then this record should be consider as "RENEW VALUE" and when P NO is unique then this should be considered as "LOST VALUE"
like .. check below records
here P NO 122 old policy no is 111 because in previous year this P NO may initiated so when again same P NO is assigned then should be 122-1 and should be renew because policy is again assigned
other records is lost value because each policy is not repeated in different years .. if 0002 is repeated in 2019 then this should be renewed and P NO will be P/03/Me/2018/00002-1 and old policy will be 0002 ... but currently 0002 is not repeated so this is "LOST VALUE"
i tried this but the result is not matched with actual output
What i want as output
i also attach qlikview and excel file
I tried this in script but result is wrong
If(WildMatch(SubField([P No.],'-',1),SubField([P No.],'-',1)),'renew', 'lost') as Flagas
kindly check and help
dropbox link
https://www.dropbox.com/sh/mqj68yanwhuk8hg/AAA_31aC7C0jqwhBpDi_r6MBa?dl=0