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: 
sspawar88
Creator II
Creator II

Sustring function


Hi,

I have field in which numbers are as like 00000000001, 00000000025,00000000035 etc

i want to replace first 9 zeros with null i.e 01,25,35

How can i acieve this?

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Num(YourField,'00') as YourField

This will make sure that you have at least 2 digit for any number.

View solution in original post

9 Replies
Anil_Babu_Samineni

Why can't simply

Right(FieldName,2)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
asgardd2
Creator III
Creator III

Hello!

num(FieldName,'00')

sspawar88
Creator II
Creator II
Author

this should be only when those 9 digits are zero. how can we identify the zero's in string?

Anil_Babu_Samineni

Can you send the Real data which demonstrates the Output

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
MK_QSL
MVP
MVP

Num(YourField,'00') as YourField

This will make sure that you have at least 2 digit for any number.

surendraj
Specialist
Specialist

Hi,

You can count the number of zeros in string by using

SubStringCount(Feildname,'0')

if you want to remove the zeros in string

replace(Feildname,'0','')

Hope this may help you!!


--Surendra

sspawar88
Creator II
Creator II
Author

Great !! Thank You Manish !!

varshavig12
Specialist
Specialist

=if(sum(left(YourField,9))=0,mid(YourField,10),no) as YourField

sspawar88
Creator II
Creator II
Author

Right