Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I have below sample data -:
Product Code Product
101 A_1
102 B_2
103 C 123
104 D_3
105 F maximum
106 G minimum
107 H_4
108 I_5
in above data i want only those data which is present after underscore and remaning cases same data.
Expecated O/P-:
Product Code Product
101 1
102 2
103 C 123
104 3
105 F maximum
106 G minimum
107 4
108 5
Thanks in advance,
Ishwar
Hi Ishwar,
you can use the textbetween function
textbetween(Product,'_','')
hope that helps
Joe
Hi,
Use subfield()
Like subfield(Product,'_',2)
Regards,
May be like this
load *, if(len(trim(Product))=3,SubField(Product,'_',2),Product) as Test,
if(wildmatch(Product,'*_*'),subfield(Product,'_',2),Product) as NewProduct;
load * Inline
[
ProductCode,Product
101,A_1
102,B_2
103,C 123
104,D_3
105,F maximum
106,G minimum
107,H_4
108,I_5
];
Regards
ASHFAQ
Hi,
try like this
if(wildmatch(Product,'*_*'),subfield(Product,'_',2),Product) as New Product
Regards
Hi,
You can use
IF (ISNULL(SubField(Product,'_',2)),Product,SubField(Product,'_',2)).
Please find the attached file.
Hope this will helps for you.
-Sathish
Or you can even try this.
if(wildmatch(Product,'*_*'),subfield(Product,'_',2),Product) as NewProduct;
Regards
ASHFAQ
subfield(Product,'_',if(index(Product,'_')=0,1,2))