Skip to main content

I'm reading from a dataset that represents boolean values as a "-1" for true and a "0" as false. I'm attempting to write these values into a dataset that represents booleans as a "Y" for true and a "N" for false.

I can make the "-1" -> "Y", "0" -> "N" conversion by using the AttributeValueMapper transformer, but that only works for one attribute at a time. The source dataset has about 20 boolean fields, so creating a transformer for each of those would be a time consuming and tedious process. I was wondering if there was some transformer I could use to map all these boolean values at once, or if there was a whole different approach I could take.

I would go with two StringReplacers.

 

 

You select which attributes to apply them to, one for the -1 => Y, and the other for the 0 => N

The StringReplacer would be the easiest way to go. That one works for multiple attributes. You would need two (one for True and one for False):

Even nicer would be to use the SchemaMapper, but that takes a little more to configure.


I would go with two StringReplacers.

 

 

You select which attributes to apply them to, one for the -1 => Y, and the other for the 0 => N

Thanks, this works wonderfully


Reply