Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
capriconuser
Creator
Creator

Repeated and unique values in qlikview

 
 

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

actual result Actual result

What i want as output

Output result

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

3 Replies
Miguel_Angel_Baeyens

Use EXISTS()

If(EXISTS(SubField(...), 'renew', 'lost') AS flagas

capriconuser
Creator
Creator
Author

THIS SHOWS AN ERROR ON EXISTS KEYWORD

Miguel_Angel_Baeyens

I may have missed a comma in my example or displaced a parenthesis, but post your line for better troubleshooting.