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: 
lucasx15
Contributor III
Contributor III

Strings Right and Index

Hello everybody.

I have a doubt, I'm different needing to separate these values ​​that are concatenated 2735489-80, in two fields.
I'm using the following in my script:


RIGHT(CD_CALENDAR,INDEX(CD_CALENDAR,'-',2)-1) AS test

However, the value is coming to null. What am I doing wrong?

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer
MVP
MVP

You may simplify this task by using subfield(CD_CALENDAR,'-',2).

- Marcus

View solution in original post

2 Replies
Or
MVP
MVP

Index(Field,'-',2) looks for the second instance of '-' in the string. Since there is only one '-' in the string, this presumably returns null.

marcus_sommer
MVP
MVP

You may simplify this task by using subfield(CD_CALENDAR,'-',2).

- Marcus