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: 
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

Labels (1)
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
MVP
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