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

How to use RIGHT() for string value?

Hi guys,

i have data as such AB_apple, AB_orange,AB_lemon, CD_chicken, CD_Beef, CD_Fish.

my expected result is i only want to show result - apple, orange,lemon WITHOUT the AB_ ?

I have  tried to write this expression, it didnt work.

if(right(fieldname,3)='AB_' ,fieldname)

HElp pls!

Rgds

Jim

1 Solution

Accepted Solutions
sunny_talwar

Why do you need if? This should be enough I think:

SubField(PRD_NAME, '_', 2)

View solution in original post

7 Replies
sunny_talwar

You can try this:

SubField(fieldname, '_', 2)

jim_chan
Specialist
Specialist
Author

is u again bro. i wonder where r u living, obviously, in earth.

jim_chan
Specialist
Specialist
Author

Sunny,

i wrote this expression as such : if(SubField(PRD_NAME, '_', 2),PRD_NAME) , not working.

sunny_talwar

Why do you need if? This should be enough I think:

SubField(PRD_NAME, '_', 2)

jim_chan
Specialist
Specialist
Author

thank you bro!

jim_chan
Specialist
Specialist
Author

Sorry bro, but i only need data that start with AB_ and CD_ . how to do that?

SubField(PRD_NAME, 'AB_', 2)

sunny_talwar

May be this:

If(Match(SubField(PRD_NAME, '_', 1), 'AB', 'CD'), SubField(PRD_NAME, 'AB_', 2))