Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mgolinvaux
Contributor II
Contributor II

Problem with "right" function in script

Hello, i'm facing a strange bug with the "right" function in my script.

I wan't to get the last five characters in a string with letters and numbers (XX00000000 or more numbers) ,so i use this:

num(right(MYFIELD,5),'00000') as Field

The problem is when the string contain some "0", the function not works properly. The function get only characters before the "0", example:

DE60831584 -> 31584 -> correct

DE24708585 -> 8585 instead of 08585

DE0344700003 -> 0003 instead of 00003

It seems the function delete a "0" in the position 5.

When i'm using the function in a text box, that works perfectly (see attachment), i don't understand why this is not working in script.

We using QV 11.20 SR15.

Thank you for your help.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Try adding a text() function to prevent QV from using number representation:


text(num(right(MYFIELD,5),'00000'))as Field


-Roob

View solution in original post

6 Replies
Anil_Babu_Samineni

I am not facing any issue. Using QV12.10

Capture.PNG

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
devarasu07
Master II
Master II

Hi,

I've tested in Qv 11.2 SR12 version and it's working fine. may be double check your end if the issue still exists try to raise ticket with Qlik support.  Thanks

Capture.JPG

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Try adding a text() function to prevent QV from using number representation:


text(num(right(MYFIELD,5),'00000'))as Field


-Roob

mgolinvaux
Contributor II
Contributor II
Author

Hello Rob,

Thank you for this, it works perfectly!

Have a nice day,

Regards.

mgolinvaux
Contributor II
Contributor II
Author

Hello Devarasu,

Unfortunately, i don't wan't to change version of Qlikview on our serveur because it will cause some bugs, that's why we have changed to SR15 préviously.

Rob found a solution for me, thank you your answer by the way.

Regards.

mgolinvaux
Contributor II
Contributor II
Author

Hello Anil,

Thank you for your asnwer but we can't change version of Qlikview actually, our serveur is not ready for a migration yet.

Regards.