field.replace("this","that") as newfield
Hi, betatesting 7 and was wondering if I can't use one transform to do this:
emit *
emit Office.replace("Proffice-", "") as AOffice
emit AOffice.replace("PIL-", "") as BOffice
emit BOffice.replace("Care Läkar-","") as COffice
emit COffice.replace("Care Läkar -","") as DOffice
emit DOffice.replace("PS-","") as EOffice
Or do I need one transform for every replace?
Regards
thomas
-
Hi Thomas,
If the intention is to output a single field where all the prefixes have been stripped from the values in the 'Office' field then you can just chain the replace() statements, e.g.
FOffice = Office.replace("Proffice-", "").replace("PIL-", "").replace("Care Läkar-","").replace("Care Läkar -","").replace("PS-","")
emit *, FOffice
If you really want to output separate fields for each new field (AOffice - EOffice) then you could use this script:
AOffice = Office.replace("Proffice-", "")
BOffice = AOffice.replace("PIL-", "")
COffice = BOffice.replace("Care Läkar-","")
DOffice = COffice.replace("Care Läkar -","")
EOffice = DOffice.replace("PS-","")
emit *, AOffice, BOffice, COffice, DOffice, EOfficeRegards,
Adrian
Please sign in to leave a comment.
Comments
2 comments