Athu
Athu

Reputation: 79

Pentaho set field Value based on other field like in SQL

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

Answers (1)

Athu
Athu

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

Related Questions