2 coalesce field on a transform map not working properly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2022 06:03 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2022 09:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2022 10:14 PM
Is the value from source saved as a currency in your staging table or as a number/string?
BR, Gaurav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2022 10:16 PM
It's number on staging table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2022 10:21 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2022 11:06 PM
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.