I am getting error as "Malformed IF statement"
IF contains([DMA],"_SafariTest")
THEN REPLACE([DMA],"_SafariTest"," Safari Test")
ELSE IF contains([DMA],"_Safari Test")
THEN REPLACE([DMA],"_Safari Test"," Safari Test")
ELSE IF contains([DMA]," SafariTest")
THEN REPLACE([DMA]," SafariTest"," Safari Test")
ELSE [DMA] ENDIF
Kindly help me figure out where the error is.
Solved! Go to Solution.
ElseIf instead of Else If
IF contains([DMA],"_SafariTest")
THEN REPLACE([DMA],"_SafariTest"," Safari Test")
ELSEIF contains([DMA],"_Safari Test")
THEN REPLACE([DMA],"_Safari Test"," Safari Test")
ELSEIF contains([DMA]," SafariTest")
THEN REPLACE([DMA]," SafariTest"," Safari Test")
ELSE [DMA] ENDIF
cheers,
mark
You miss two ENDIF.
In addition to the answers already provided, you might want to take a look at the Find Replace tool.
As mentioned above, look into using the find and replace tool. That way you only need to update the input tool with the find and replace mapping, rather than having additional conditional statements. This will also increase performance run times if you are using large datasources.
See attached for an example. Let me know if that helps and/or if you have additional questions!