Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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

 

1 Solution

Accepted Solutions
marcus_sommer

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
tresesco
MVP
MVP

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

tresesco
MVP
MVP

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

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