2 coalesce field on a transform map not working properly

Evren Yamin
Tera Contributor

Hello,

I have a transform map that needs to have 2 coalesce field but it is not working. It just inserts instead of updating the record. Does having 2 coalesce work?

Appreciate all the help

15 REPLIES 15

Unfortunately this is not working, I'm getting undefined value of currency

find_real_file.png

Community Alums
Not applicable

Is the value from source saved as a currency in your staging table or as a number/string?

BR, Gaurav

It's number on staging table

Community Alums
Not applicable

Then you do not need to use getCurrencyValue(). Try using "source.u_expenditure" and see if it matches.

Also, you may want to run the code in the Fix script or Background script first to see if it is working.

BR, Gaurav

All fields of the source table should be of type String. Thus those won't have the getCurrencyValue() method. You need to extract the currency and the amount from the text in the amount field ($1,000). Then you need to use the information obtained to add a query along the lines of:

cost_center.addQuery('u_expenditure', 'javascript:global.getCurrencyFilter(\'sc_cat_item\',\'price\',\'USD;1000\')');

I mean in place of what you had above.