Handling numeric operations in Nifi UpdateRecord using record path

1k Views Asked by At

I am using UpdateRecord Processor in Nifi where I need to get value from one record path (/amount), add some value to it and put the resulting value to another record path (/result). I could not find any way of doing this. Any help would be great!!

UpdateRecord Screenshot

1

There are 1 best solutions below

0
Lamanus On

Use UpdateRecord twice.

The first one is

Record Reader               CSVReader
Record Writer               CSVRecordSetWriter
Replacement Value Strategy  Record Path Value
/result                     /amount

and the second one is

Record Reader               CSVReader
Record Writer               AvroRecordSetWritter
Replacement Value Strategy  Literal Value
/result                     ${field.value:toNumber():plus(1000)}

where the answer is based on my the other answer, Add two columns together using apache-nifi