Newer Version Available
Considerations for Querying Currency Data Using SOQL
These considerations apply when using SOQL to query Data Cloud objects, such as data
lake objects (DLOs) and data model objects (DMOs).
- Use the cdp_sys_record_currency__c system field to query the ISO code value of a Data Cloud record.
- If an SOQL query on Data Cloud objects returns null values for all currency fields, the ISO code is unsupported or invalid. Check the cdp_sys_record_currency__c system field to make sure the ISO codes are supported by your org, or verify that it matches the default corporate currency if you're using a single currency. If all records are stored with valid ISO codes, make sure the org setup page has these ISO codes configured as supported currencies. To set up the supported currencies, see Manage Multiple Currencies.
- When querying currency data from Data Cloud objects using a SELECT clause, use an alias on
the toLabel() function for the CurrencyIsoCode field. However, aliasing isn't required when using currency
fields in a WHERE or ORDER BY clause.
- Valid: SELECT toLabel(CurrencyIsoCode) CurrencyCodeAlias, Currency__c FROM <DMO/DLO>
- Invalid: SELECT toLabel(CurrencyIsoCode), Currency__c FROM <DMO/DLO>
- The convertCurrency() function doesn't round the result to configured decimal places for the currency in your org when it's used on currency fields from Data Cloud objects.