web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Duplicte key error during processing of AX 2012 default Production cube

(0) ShareShare
ReportReport
Posted on by

Hi All,

I get the error/warning listed below when I process the Production cube from SQL/SSAS.

I have previously gotten the same error on other AX views on other fields/attributes and found several explanations that the error is caused by a join of records with NULL-values. In my mind this cannot be the cause here when the error is on DATAAREAID which should be present on all records in any join.

"Errors in the OLAP storage engine: A duplicate attribute key has been found when processing: Table: 'WRKCTRTABLEEXPANDED', Column: 'DATAAREAID', Value: 'dnp'. The attribute is 'DATAAREAID'. Errors in the OLAP storage engine: The record was skipped because the attribute key is a duplicate. Attribute: DATAAREAID of Dimension: Resources from Database: Dynamics AX initial, Record: 3."

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    After examining the tables in the view I spotted that:

    1) The view opened from the AOT had two records pointing to the same WrkCtrId.

    2) The table WrkCtrResourceGroupResource (used in the view and which links resources to resource groups) had two records referring to this WrkCtrId. One record had a from- and to-date and the second had a from-date (matching the to-date of the other one) and no to-date. This date setup is of course ok but somehow it causes the error.

    After deleting one of the records (the one with both dates set) the cube can process.

    Can someone explain why SSAS has trouble handling such a condition?

  • Community Member Profile Picture
    on at

    _

  • Lance [MSFT] Profile Picture
    on at

    This is ignorable and has nothing to do with the date entries.  For reasons not clear to me it tends to get reported only when doing full processing, so it can appear to go away when reprocessing a previously processed dimension because the default processing type in ssas is not a full process.  

    The explanation for this is when ssas joins a dimension to a measure group if the join column in the measure group is null ssas incorrectly, at least in my opinion, logs a null key error.  This should really be a warning not an error as nulls are allowed in join fields.  Lots of people were seeing these null key errors and would call up tech support to ask what they mean.  To avoid having all these null errors and to speed up processing (which was impact by having to log all those messages), in the data source view, for every dimension query, an extra row is added per company where the values for the row are all set to N/A for strings or 0 for numeric types.    When grouping by the dimension, any row in the measure group that have NULLs in the join columns are displayed under the attribute value N/A.

    This has a side effect on the DataAreaId attribute.

    The query for that attribute ends up with two values per company, one where the company name is N/A and one where the company name is the real name of the company.  The reason a duplicate key warning is reported for this attribute is because of the presence of the extra row linked to the company that has N/A for the company value but is linked to the company.

    The impact is that when a query groups by dataareaid attribute, the data rows will be linked to the first row for the company, which is what one would want anyway, and not to the N/A row.

    You can see the N/A row is triggeing this by getting the query ssas uses for the dataareaid attribute and running it.

    When you process the dimension from sql management studio, if you expand the dimension entry in the results and then expand the result for the attribute, you should be able to see the query for the attribute.

    I get this query.  Yours should be similar except that the filter value for the partition field will probably be a different number.

    SELECT

     DISTINCT

    [WRKCTRTABLEEXPANDED].[DATAAREAID] AS [WRKCTRTABLEEXPANDEDDATAAREAID0_0],[WRKCTRTABLEEXPANDED].[DATAAREAID_NAMECOLUMN] AS [WRKCTRTABLEEXPANDEDDATAAREAID_NAMECOLUMN0_1]

     FROM

      (

    SELECT WORKCENTERSSITE, WORKCENTERS, WORKCENTERGROUP, CAPACITYUNIT, WORKCENTER, WRKCTRID, CATEGORYNAME, COSTCATEGORYID, CATEGORYTABLE, SITE, PRODUCTIONUNITS, PRODUCTUNIT, DATAAREAID, PARTITION, RECID, NAME, RESOURCEGROUPID, DATAAREAID AS DATAAREAID_NAMECOLUMN, 0 AS BI_ISNOTAPPLICABLE FROM [DBO].WRKCTRTABLEEXPANDED  WHERE WRKCTRTABLEEXPANDED.PARTITION = 5637144829   UNION ALL SELECT NOTAPPLICABLE.WORKCENTERSSITE AS WORKCENTERSSITE, NOTAPPLICABLE.WORKCENTERS AS WORKCENTERS, NOTAPPLICABLE.WORKCENTERGROUP AS WORKCENTERGROUP, NOTAPPLICABLE.CAPACITYUNIT AS CAPACITYUNIT, NOTAPPLICABLE.WORKCENTER AS WORKCENTER, NOTAPPLICABLE.WRKCTRID AS WRKCTRID, NOTAPPLICABLE.CATEGORYNAME AS CATEGORYNAME, NOTAPPLICABLE.COSTCATEGORYID AS COSTCATEGORYID, NOTAPPLICABLE.CATEGORYTABLE AS CATEGORYTABLE, NOTAPPLICABLE.SITE AS SITE, NOTAPPLICABLE.PRODUCTIONUNITS AS PRODUCTIONUNITS, NOTAPPLICABLE.PRODUCTUNIT AS PRODUCTUNIT, KEYCOLUMNS.DATAAREAID AS DATAAREAID, NOTAPPLICABLE.PARTITION AS PARTITION, NOTAPPLICABLE.RECID AS RECID, NOTAPPLICABLE.NAME AS NAME, NOTAPPLICABLE.RESOURCEGROUPID AS RESOURCEGROUPID, NOTAPPLICABLE.DATAAREAID_NAMECOLUMN AS DATAAREAID_NAMECOLUMN, 1 AS BI_ISNOTAPPLICABLE FROM  ( SELECT DISTINCT DATAAREAID FROM [DBO].WRKCTRTABLEEXPANDED  WHERE PARTITION = 5637144829 ) AS KEYCOLUMNS CROSS JOIN ( SELECT CAST(N'N/A' AS NVARCHAR(3)) AS WORKCENTERSSITE, '' AS WORKCENTERS, CAST(N'N/A' AS NVARCHAR(3)) AS WORKCENTERGROUP, NULL AS CAPACITYUNIT, CAST(N'N/A' AS NVARCHAR(3)) AS WORKCENTER, CAST(N'N/A' AS NVARCHAR(3)) AS WRKCTRID, CAST(N'N/A' AS NVARCHAR(3)) AS CATEGORYNAME, CAST(N'N/A' AS NVARCHAR(3)) AS COSTCATEGORYID, '' AS CATEGORYTABLE, CAST(N'N/A' AS NVARCHAR(3)) AS SITE, CAST(N'N/A' AS NVARCHAR(3)) AS PRODUCTIONUNITS, CAST(N'N/A' AS NVARCHAR(3)) AS PRODUCTUNIT, 0 AS PARTITION, 0 AS RECID, '' AS NAME, 0 AS RESOURCEGROUPID, CAST(N'N/A' AS NVARCHAR(3)) AS DATAAREAID_NAMECOLUMN, 1 AS BI_ISNOTAPPLICABLE ) AS NOTAPPLICABLE

      )

      AS [WRKCTRTABLEEXPANDED]

    When I run this query I get back duplicates too.

    WRKCTRTABLEEXPANDEDDATAAREAID0_0 WRKCTRTABLEEXPANDEDDATAAREAID_NAMECOLUMN0_1

    dat dat

    dat N/A

    Hope this helps understand what is happening,

    --Lance

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans