Solved

Replace attribute values for all attributes

  • 3 November 2018
  • 3 replies
  • 62 views

Hi all,

I want to replace not equal to "0" to "1" and if any value missing replace to "0"

 

Original

Attribute1Attribute2Attribute3Attribute4Attribute5Attribute6Attribute7Attribute8231212301235650

 

231230231000031240000370232102312234340000320001220023232123120127700

 

 

 

Expected result

Attribute1Attribute2Attribute3Attribute4Attribute5Attribute6Attribute7Attribute8110110010100001000011010111000010001001110110000

 

Please advise

icon

Best answer by takashi 3 November 2018, 12:34

View original

3 replies

Userlevel 4
Badge +30

Hi @venu

 

I created your case here with only two transformers.

StringReplacer - to find any number more than 0

NullAttributeMapper = to find <missing> values and replace to 0

 

 

Results:

 

 

Attached the Workspace template - FMWT.

 

Workspace_Replace_Values.fmwt

 

Thanks,

Danilo

Userlevel 2
Badge +17

I would firstly use the NullAttributeMapper to replace every missing, empty, or null attribute with 0, then use the ExpressionEvaluator to assign 1 to every non-0 attribute.

I would firstly use the NullAttributeMapper to replace every missing, empty, or null attribute with 0, then use the ExpressionEvaluator to assign 1 to every non-0 attribute.

thank you very much

Reply