Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am trying to remove the delimiter(-) from my one of the column, If my column contains values like
HYN 2500 - large cab,
Svera 1800 - large cab
R - 250 - large cab.
From the above fields i want remove the large cab means right side part i want kepp the left side part only for the above fileds i have removed left part after the delimiter ( - ) from 2 fileds using index function result is
HYN 2500
Svera 1800
R
But in the last field i want the filed R-250 here after the second delimiter the test should be wiped out. I ahve tried multiple ways but not getting correct logic. can any one help on this. Please find the attached sample app.
Try this expression:
=iF(index(Name,'-'),Mid(Name,1,Index(Name, '-', -1)-2),Name)
Subfield(Name,'-',1) will help you achieve that
try this
=index('R-250 - Large', '-', -1)
will find the first "-" from right
Try this expression:
=iF(index(Name,'-'),Mid(Name,1,Index(Name, '-', -1)-2),Name)
Hi tresesco,
Thanks for your quick replay, it worked perfectly. Could you please explain the expression am not able to understand it, how it is doing der...
Index(Name, '-', -1) => gets the position of the last '-' in the string // '-1' indicates to find the first occurance of the character starting from the end. IF statement is used to get the field Name in it's entirety when there is no '-', otherwise remove the part from last occurance of '-'.