CDM icon indicating copy to clipboard operation
CDM copied to clipboard

Datatype issues in Sustainability CDM

Open lnewportmsft opened this issue 2 years ago • 8 comments

For example, under Emissions, the following attributes are listed as dateTime:

calculationdate consumptionenddate consumptionstartdate transactiondate

However, it is necessary on import to apply a datatype transformation to "date" in PowerQuery for the import to succeed. Absent this transformation the import fails.

Should these be "date" in the Sustainability CDM?

lnewportmsft avatar Jun 29 '22 18:06 lnewportmsft

Hi @lnewportmsft , sorry we missed your message. I'll check the datatype problem with these attribute, at the same time, can you please elaborate how you import the schema in PowerQuery with repro steps?

dingbx avatar Jul 05 '22 18:07 dingbx

These are datetime with date-only format. It can be discovered by examining dataverse backend - image

Refer to the following for date behavior doc: https://docs.microsoft.com/en-us/power-apps/maker/data-platform/behavior-format-date-time-field

scheyal avatar Jul 05 '22 20:07 scheyal

Hi @dingbx - if you take this Excel sheet (https://aka.ms/AAhg2w0) and import it into Sustainability Manager for Precalculated Emissions via the following steps, you will see repro.

  1. Import
  2. Map to CDM (in Power Query).
  3. These columns will be defined as DateTime
  4. Import will fail with type error.

(Import works if after Map to CDM, DateTime is changed to Date) for each affected column.

lnewportmsft avatar Jul 08 '22 18:07 lnewportmsft

Hi @lnewportmsft , thanks for bringing this issue to attention. Yes, these need to be date in the CDM schema too. We will work with the Sustainability team on getting the relevant schemas updated in an upcoming release.

Venkata1920 avatar Jul 12 '22 18:07 Venkata1920

The failure is b/c Calculation date is missing. It should work just fine otherwise.

scheyal avatar Sep 21 '22 20:09 scheyal

The failure is b/c Calculation date is missing. It should work just fine otherwise.

I'm not sure you understand what issue we're trying to get resolved here.

andresravinet avatar Sep 22 '22 00:09 andresravinet

I don't see the issue here. Maybe you can explain in details again?

I tried a repro with the link.

That XLS was missing calc date (was null). When I import it (no manual or auto-mapping), PQ does a transformation as follows (and just succeeds):

XLS: image

PQ view (not edited): image

scheyal avatar Oct 11 '22 23:10 scheyal

Hi,

Just wanted to check the current status of this issue. Has the issue been resolved?

If I understand it correctly, the issue is the schema in Map to CDM dialog, which the source data has been mapped to, has some of the attributes defined with datetime, but their type should be date.

and these attributes are:

  • calculationdate
  • consumptionenddate
  • consumptionstartdate
  • transactiondate

If this is the root cause, then sustainability team can check their schema and update them if those types should be date. And if this is not the problem, it might be the validation should also accept datetime.

dingbx avatar Oct 19 '22 22:10 dingbx

Closing this issue since the explanation was provided through email, please reopen if the issue is not resolved.

dingbx avatar Dec 13 '22 18:12 dingbx