[SalesForce] Handling Dates in Einstein Analytics UTC vs Local DateTime

Our users are using the New York timezone in Salesforce (UTC – 4 or -5 depending on DST). It appears that the dates are stored in SF as UTC. Salesforce reports that need date ranges work fine because the UI takes the users Timezone into consideration. It appears that Wave (Einstein Analytics) does not do this natively/automagically. Is there a setting for Wave/Einstien to force the DataFlow to generate DataSets with the local date/time? All the info I found online about this indicates that a new DateTime field needs to be created using the todate() function, something like this: "saqlExpression": "toDate(CreatedDate_sec_epoch – 4*3600)"

Best Answer

True, Many of the MNC companies face this Challenge. You found the solution yourself. In Einstein Analytics you can add a computed Date field which can calculate the user time zone. for example you can create a field something like below and use it everywhere

"Extract_Opportunity": {
  "action": "computeExpression",
  "parameters": {
    "source": "Digest_Opportunity",
    "mergeWithSource": true,
    "computedFields": [
     {
      "name": "CreatedDateNew",
      "type": "Date",
      "format": "MM/dd/yyyy",
      "saqlExpression": "toDate(CreatedDate_sec_epoch - 8*3600)"
     }
    ]
  }
},
Related Topic