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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with Right() function!

Hi,

I'm using QV 8.5 and I'm having a problem with the right() function.

This is what I'm writing:

LET V_File_Ext = right(text('ABC123567901xls'),12);

And it's returning 123567901xls.

It should returing xls since I have 12 chars before it.

Am I doing something wrong?

The QV file is attached.

Thanks,

Cassiano

1 Solution

Accepted Solutions
Not applicable
Author

The function is working as expected. Per the documentation, the Right() function returns the rightmost n characters. So, Right('somelongstring', 12) will return 'melongstring'.

The relevant portion of the documentation reads "Substring of the string s. The result is a string consisting of the last n characters of s."

View solution in original post

3 Replies
Not applicable
Author

The function is working as expected. Per the documentation, the Right() function returns the rightmost n characters. So, Right('somelongstring', 12) will return 'melongstring'.

The relevant portion of the documentation reads "Substring of the string s. The result is a string consisting of the last n characters of s."

Not applicable
Author

Thanks, I didn't understand the function before.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If you want to extract the extension from the filename a good function is subfield()

LET V_File_Ext = subfield('ABC12356790.xls', '.', -1);

-Rob