Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a field called 'Product ID' as below.
If the field values is end with 7539 we need to name it as ProductA and if field values is end with 17973 we need to name it as ProductB.
Thanks..
How about
LOAD ...
[Product ID],
Pick(Match(SubField([Product ID], '-', -1), '7529', '17973'), 'ProductA', 'ProductB') AS [Product Name],
...
FROM ...;
Your example contains only two cases. If you need to translate a large(r) number of Product IDs, then use a Mapping Table instead of Pick/Match.
Best,
Peter
How about
LOAD ...
[Product ID],
Pick(Match(SubField([Product ID], '-', -1), '7529', '17973'), 'ProductA', 'ProductB') AS [Product Name],
...
FROM ...;
Your example contains only two cases. If you need to translate a large(r) number of Product IDs, then use a Mapping Table instead of Pick/Match.
Best,
Peter
try this in script:
if(right(Product_ID,4)='7539','prod_A',if(right(Product_ID,5)='17973 ','prod_B','Prod_C')) as Prod
try like below
subfield(Fieldname, '-', 1) as ProductB,
subfield(Fieldname, '-', 2) as ProductA ,