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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
johnan
Creator III
Creator III

Zero Problems

Hi,

I have in my database a field that contains a 16 characters.

In table 1 real data it is 0000000032043988

In table 2 it is just 32043988 and stripped away all zeros in database.

In qlikview you can use Right(Field,8) to convert.

Can i use som function to strip all the zeros from table 1 instead?

Br

John

 

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer
MVP
MVP

Only values with max. 15 digits are numbers in Qlik - if the values are processed in any way it are only 14 digits. This means your values couldn't be directly formatted in your wished way and also not be converted - the conversion worked only if it happens within their limits.

But you could use string-functions to remove the leading zero's, maybe something like this:

num(mid('0000000035257451', findoneof('0000000035257451', '123456789')))

- Marcus

View solution in original post

6 Replies
tresB
Champion III
Champion III

You can use num() to get rid of leading zeros. I.e. -

Num(0000000032043988) - gives  32043988

johnan
Creator III
Creator III
Author

Hi, try that, it gives me nothing 😞

Num(TRTREF) as [Pick control number], give QlikView "-"
TRTREF as [Pick control number2], give QlikView "0000000032043988"

I think the field is text in DB

tresB
Champion III
Champion III

Are the quotes part of your data (you see in qv)? If so, you could try like:

Num(Keepchar(TRTREF, '0123456789'))  as [Pick control number]

johnan
Creator III
Creator III
Author

Hi,

No, no quotes .

The data is : 0000000035257451 and it text i guess

Still doesn't work 

marcus_sommer
MVP
MVP

Only values with max. 15 digits are numbers in Qlik - if the values are processed in any way it are only 14 digits. This means your values couldn't be directly formatted in your wished way and also not be converted - the conversion worked only if it happens within their limits.

But you could use string-functions to remove the leading zero's, maybe something like this:

num(mid('0000000035257451', findoneof('0000000035257451', '123456789')))

- Marcus

johnan
Creator III
Creator III
Author

This works!

Thanx Man!

Br

John