0

Data Stream in Data Cloud wants to create Formula Fields and convert existing text-type columns into date types.

The value of the column in the existing text format is '20231101', and we tried three ways to change it.

  1. FORMATDATE(sourceField['SALE_DATE__c'],'yyyy-MM-dd')
  2. PARSEDATE(sourceField['SALE_DATE__c'],'yyyy-MM-dd')

DATE( LEFT(sourceField['SALE_DATE__c'], 4), MID(sourceField['SALE_DATE__c'],5,2), RIGHT(sourceField['SALE_DATE__c'],2) )

However, there is an error that the formula is incorrect, or a problem that the test proceeds, but the converted value cannot be determined in the Data Explorer.

Does any expert know how to fix this?

1
  • Hi, did you ever figure this one out? I have the same problem currently Commented Apr 16 at 19:27

1 Answer 1

0

The problem seems to be your MID() function, I don't think this is a valid function for those formula fields. Instead, you can use SUBSTRING():

DATE(LEFT(sourceField['SALE_DATE__c'], 4), SUBSTRING(sourceField['SALE_DATE__c'], 4, 6), RIGHT(sourceField['SALE_DATE__c'], 2))
1
  • It'd be helpful if you could find and link to documentation to corroborate your claim. Closest I could find after a little digging is help.salesforce.com/s/… but I haven't used datacloud
    – Derek F
    Commented Apr 30 at 12:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .