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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
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

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

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

- Marcus