Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
KKumar92
Contributor III
Contributor III

Using SubField Function to Extract String Value

This is a sample of the data set I am processing,

Product Id
AC1320ABC
EC3210ECD
BC1250RED
BC3500CED

I want to create a Field as "Product" and it should only contain the Last Three String of the Product_ID as follow;

Product IdProduct
AC1320ABCABC
EC3210ECDECD
BC1250REDRED
BC3500CEDCED

I have used the below script, but it does not generate the expected answer.

SubField(if(Index(Product_ID,'0')=0,Product_ID,
Mid(Product_ID,1,Index(Product_ID,'0',1)-1)),'|') as Product,

Please advise on this, appreciate your support and guidance.

Labels (3)
1 Solution

Accepted Solutions
MayilVahanan

HI @KKumar92 

Try with Right() function.

ex: Right([Product Id],3) 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

2 Replies
MayilVahanan

HI @KKumar92 

Try with Right() function.

ex: Right([Product Id],3) 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
KKumar92
Contributor III
Contributor III
Author

Thank You @MayilVahanan  , it is working.