Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I would like to create a mapping table containing an ID and a Name field. I want the mapping table only to be filled for a special pattern in the name field:
'DExxxx', where the x's are numbers like 'DE1234'
Problem is, that the source contains enough different values like 'ENxxxx' or even names like 'Amacut' or 'Beedot'. How can I filter my pattern during load?
My current solution is LOAD if(wildmatch(NAME, 'AM*'), NAME) as Name
but this does include the 'Amacut' from my previous example and several others.
Thanks.
mapping load
ID,
NAME
from yoursource
where NAME like 'DE*'
I''m sorry, I messed up my example. In addition to the regular 'DExxxx' that I want to have, there are entries like 'DEDFF' in the same field that I want to exclude. If i could work with regular expressions like in other languages I would check for four digits after the DE.
mapping load
ID,
NAME
from yoursource
where NAME like 'DE*' and len(keepchar(NAME,'0123456789'))>0 // check if there´s valid digits