Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
johnjustus
Contributor III
Contributor III

Position of character in a string

Hi All,

I have an basic question.

I have text object with value as "ABCD%EFG%"

How can I go about finding the position of % and display in another text object?

Thanks,

John

1 Solution

Accepted Solutions
sunny_talwar

Try this

=Concat(If(Index('ABCD%EFG%', '%', ValueLoop(1, 100)) > 0, Index('ABCD%EFG%', '%', ValueLoop(1, 100))), ', ')

 

View solution in original post

6 Replies
sunny_talwar

Try this

=Index('ABCD%EFG%', '%')
johnjustus
Contributor III
Contributor III
Author

Thanks

The first occurrence displays as 5 but it is not bringing the second occurrence.

johnjustus
Contributor III
Contributor III
Author

Thanks

I used this expression and it returns 8. But I need the position 4 also.

How can I do that?

=FindOneOf('ABC#DEV#','#',2)

sunny_talwar

Try this

=Concat(If(Index('ABCD%EFG%', '%', ValueLoop(1, 100)) > 0, Index('ABCD%EFG%', '%', ValueLoop(1, 100))), ', ')

 

johnjustus
Contributor III
Contributor III
Author

Wow.  That's an awesome advanced expression and it works.

Thanks much Sunny!