Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

mgolinvaux
New 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
MVP & Luminary
MVP & Luminary

Re: Problem with "right" function in script

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


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


-Roob

6 Replies

Re: Problem with "right" function in script

I am not facing any issue. Using QV12.10

Capture.PNG

Life is so rich, and we need to respect to the life !!!
devarasu07
Honored Contributor II

Re: Problem with "right" function in script

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

MVP & Luminary
MVP & Luminary

Re: Problem with "right" function in script

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


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


-Roob

mgolinvaux
New Contributor II

Re: Problem with "right" function in script

Hello Rob,

Thank you for this, it works perfectly!

Have a nice day,

Regards.

mgolinvaux
New Contributor II

Re: Problem with "right" function in script

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
New Contributor II

Re: Problem with "right" function in script

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.