Skip to main content

Integration, Extension & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
Skip the ticket, Chat with Qlik Support instead for instant assistance.
cancel
Showing results for 
Search instead for 
Did you mean: 
Ran
Contributor II
Contributor II

LOOP ADDING VALUE TO ID(validationID)

hi

 i have field  "ID"  with 5-9 digits

i need to  that all ID to be 9 digits

and to add "0" to the 5-8 digits

example 

ID

123456789 -> 123456789

12345->000012345

1234567->001234567

after that i need to make more calcuation that check if ID is vaild/invaild

thanks!

 

 

Labels (2)
1 Solution

Accepted Solutions
Taoufiq_Zarra

@Ran  you can use this expression :

repeat('0',9-len(ID))&ID as New_ID

example :

DATA:
load *,repeat('0',9-len(ID))&ID as New_ID inline [
ID
123456789
12345
1234567
];

 

output:

Taoufiq_Zarra_0-1672609213793.png

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

2 Replies
Taoufiq_Zarra

@Ran  you can use this expression :

repeat('0',9-len(ID))&ID as New_ID

example :

DATA:
load *,repeat('0',9-len(ID))&ID as New_ID inline [
ID
123456789
12345
1234567
];

 

output:

Taoufiq_Zarra_0-1672609213793.png

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Ran
Contributor II
Contributor II
Author

Thanks😄