Further information
This is the code
IF( vDebug > 0 ) ;
IF( vChild @= 'X084A346' ) ;
asciioutput( vDebugPathFileMetaData , vTargetDim , vHier , vChild, vChildElemType , NumberToString( vBase0ParentLevelNum ) ) ;
ENDIF ;
ENDIF ;
HierarchyElementInsert( vTargetDim , vHier , '' , vChild , vChildElemType ) ;
This is giving this output:
"N_UCoA_Programme_Origin","Control_Budget_Hier","X084A346","c","2"
Which proves that I am trying to insert the Element as a Consolidation.
However, I am getting the error
Error: MetaData procedure line (0): Insertion of leaf "X084A346" into hierarchy "N_UCoA_Programme_Origin:Control_Budget_Hier" failed because a consolidated element by that name already exists in the dimension.
Which proves that PA is deciding to try to insert the element as an N level instead of the C level that I requested.
This is clearly a bug. If this is not the right place to report a bug, please let me know where it should be reported.
------------------------------
Paul Simon
------------------------------
Original Message:
Sent: Thu February 20, 2020 01:59 PM
From: Paul Simon
Subject: Bug in hierarchy build
I have a case where I insert an element using HierarchyElementInsert, and I can prove from asciiouput that the type being passed in to HierarchyElementInsert is C for Consol.
The Element in this case does not have any child elements linked to it.
When I run the process I get the following
Error: MetaData procedure line (0): Insertion of leaf "X013A009" into hierarchy "N_UCoA_Programme_Origin:Control_Budget_Hier" failed because a consolidated element by that name already exists in the dimension.
It would appear that, even though the element is inserted as a C, that the compilation of the hierarchy that occurs at the end of the MetaData tab is deciding that, because the element has no children, it should be inserted as an N, leaf level element, rather than as the C consolidated element that it was told to do. As the element already appears as a consol in another hierarchy, in this case the Classic or Default Hierarchy, then an error occurs.
For the moment we have worked around this by modifying our SQL query so that childless consols never appear in the source. However, this might not be acceptable in every case.
We are on PA 2.0.5
------------------------------
Paul Simon
------------------------------
#PlanningAnalyticswithWatson