Quantcast
Channel: SCN : All Content - Data Services and Data Quality
Viewing all articles
Browse latest Browse all 4013

Custom Function / Scripting Issue?

$
0
0

I've written a very quick and dirty custom function to clean up some bad data.

 

When I validate the script, it's fine.  The mapping with the calls to the script are fine (no red X on the arrow) .  But when I validate everything together, I get an error.

 

I can't cut and paste, but to summarize, the error is:

Invalid mapping expression for column. 

Syntax error at line <1>: <>; near <;> found <SUBVARIABLE>> 1 error, 0 warnings, check and fix syntax and retry

 

My script is called CF_SIMPLE_MATCH_CLEAN and it has 2 declared parameters, and 2 declared variables

$L_FLAG = match_simple($P_FIELD_VALUEs,$P_REM_STRING);

 

$L_NEW_STRING = ifthenelse($L_FLAG=1,NULL,$P_FIELD_VALUE);

 

return $L_NEW_STRING;

 

The call in the transform is this:

CF_SIMPLE_MATCH_CLEAN(MYFIELD,'{a|b}');

 

If I expand it all out to one command in the transform like this, it works fine.  So the problem must be somewhere in the variable substitution.

ifthenelse(match_simple(MYFIELD, '{a;b}')=1, NULL, MYFIELD);

 

I'm guessing it has something to do with the {} in the command, as I know those are used to indicate a variable should be put in quotes.  But I've had issues with the {} and the [] brackets not working consistently before.

 

Anyone have any ideas what I need to do to get this running?

 

Thanks, and apologies for any typos, I can't cut and paste.  If you see a missing ; or () or anything like that it's probably a typo.


Viewing all articles
Browse latest Browse all 4013

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>