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

Repeated values in string

I need a help for the below scenario where need to identify the presence of repeated Alphabets/Numbers  in the given string which can be considered as error.

Example:

AAAAAA,999,0000

 

1 Solution

Accepted Solutions
MarcoWedel

If(ID=Repeat(Left(ID,1),Len(ID)),'INVALID','VALID')

View solution in original post

6 Replies
abhijitnalekar
Specialist II
Specialist II

Hi @khadar,

When you said repeated then it supposes to continue like "AAAA" or "ABCA" also treated as an error.

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
MarcoWedel

can you please elaborate on what exactly constitutes an error, best with some more examples for both error and no error.

thanks

Marco

khadar
Contributor III
Contributor III
Author

Thank you for looking into my  help. 

I need to check the single value  (ID) which is  continues reapeating through out length of whole string  and does not contain any other values except the repeating one and should be identitfied as IN VALID like below.

Example:

ID Status  
AAAAAAA IN VALID  
44444 IN VALID  
CCCCC IN VALID  
GTH873521 VALID  
TY43ERYD76 VALID  
AAATUTR55799 VALID  
     

 

 

abhijitnalekar
Specialist II
Specialist II

Hi @khadar,

 

Please check with the below expression if that works for you.

=if(Left(ID,1)=right(ID,1),'IN VALID','VALID') 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
MarcoWedel

If(ID=Repeat(Left(ID,1),Len(ID)),'INVALID','VALID')
MarcoWedel

or slightly shorter:

If(ID=KeepChar(ID,Left(ID,1)),'INVALID','VALID')