Reputation: 79
How can I set a field value of a Row in Pentaho for a new or an existing field depending on values in other fields of the same row like in a SQL select statement. Doing this with a filter would be to time intensive doing this with multiple fields. For example:
[Price] = CASE WHEN [Price Sold] <> 1 THEN [Price Sold] ELSE [Price Bought] END
[FX Currency] = CASE WHEN [Ccy Sold] <> [RefCcy] THEN [Ccy Sold] ELSE [Ccy Bought] END
Upvotes: 1
Views: 1373
Reputation: 79
I have solved my problem by using a Step:
"User Defined Java Expression"
New Field Java Expression Price Price_Sold!=1?Price_Sold:Price_Bought
Upvotes: 2