Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Why zeros are added at start

i have different form of medical Numbers ( '2226' , 'MQ234' )

But when i do a concat code such as   Id & '-' & [Medical Number]  the format i receive for the ones 2226 is  0000 2226

how can i make it not do that ???

13 Replies
its_anandrjs

Nothing change just try the below code with current script that yo use for concat

For this

LocationID & '-' & [Medical Record No. :] & '-' & Date as FilterID,

Try This if length is 8

LocationID & '-' &  if(len([Medical Record No. :])=8,NUM([Medical Record No. :]),[Medical Record No. :]) & '-' & Date as FilterID,

Regards

arsal_90
Creator III
Creator III

You can use text()  function to handle this situation

marychen
Contributor III
Contributor III

QlikView randomly added a leading zero to one of the text fields. This solution works for my situation. Thanks!

Sergey_Shuklin
Specialist
Specialist

Hello!

Try a Len() to indicate that values are what they appear. I mean that Len(509)=3. And if it's true you can try to use it in first iteration:

LocationID & '-' & right([Medical Record No. :],len([Medical Record No. :])) & '-' & Date as FilterID

or

in the second iteration (after you've got 00000509 but len([Medical Record No. :])=3):

subfield(FilterID,'-',1)&'-'&subfield(right(FilterID,len([Medical Record No. :])),'-',2)&'-'&subfield(FilterID,'-',3)

or

you can try to multiplicate [Medical Record No. :] by 1:

LocationID & '-' & [Medical Record No. :]*1 & '-' & Date as FilterID

or

use num() function

LocationID & '-' & num([Medical Record No. :],'#') & '-' & Date as FilterID


maybe some of this helps. If it wont, then we will think next