Page 1 of 1
Subset Alias display - messed up by dim recreate
Posted: Fri Nov 19, 2010 1:38 pm
by chewza
Hi there
Whenever I recreate one of my dimensions, all my subsets for this dimension revert to showing the element code rather than the alias I chose when I saved the original subset.
The are the steps I have followed:
- Create subset - in this case for my accounts dimension
- Click the toggle to display the "Description" alias
- Save the subset.
- Close, and open to check - shows Description
- Then run Ti to refresh the accounts dimension - recreates it (uses DimensionDeleteAllElements)
- Open my subset
- It now displays the account code, and not the alias
- I can still click on the button to toggle to the Description alias - so the issue is not that the alias has not been successfully recreated.
The reason I use the recreate\DimensionDeleteAllElements is because my elements might well need to move against different consolidators - without doing a recreate, they will be incorrectly duplicated under more than one consolidator.
Any ideas?
Regards
Chris
Re: Subset Alias display - messed up by dim recreate
Posted: Fri Nov 19, 2010 3:52 pm
by ajain86
Chris,
You are recreating the dimension because the consolidations change, right?
Insted of deleting all elements, why not just loop through the dimension and only delete consolidated elements.
I prefer to go this route and have never had the issue you described.
It will keep all level 0 members intact for times when your data source maybe missing a member. This will also assure you never lose any data.
Code: Select all
sDim = Dimension name;
nSize = DIMSIZ( sDim );
nCount = 1;
While( nCount <= nSize );
sMem = DIMNM( sDim, nCount);
If( DTYPE( sDim, sMem ) @= 'C' );
DimensionElementDelete( sDim, sMem );
else;
nCount = nCount + 1;
endif;
nSize = DIMSIZ( sDim );
END;
Re: Subset Alias display - messed up by dim recreate
Posted: Sun Nov 21, 2010 5:37 pm
by PlanningDev
I have the same issue. IBM has this logged as an enhancement request. I will have to try wiping the consolidated levels so as not to have to re create the dimension and aliases though.
Re: Subset Alias display - messed up by dim recreate
Posted: Sun Nov 21, 2010 7:23 pm
by chewza
Ankur - thanks a million - works perfectly!!
Re: Subset Alias display - messed up by dim recreate
Posted: Sun Nov 28, 2010 11:05 pm
by paulsimon
Hi
Even deleting consolidated elements can be dangerous as you can lose any data that you have stored against them such as attributes and comments. This might happen if something was wrong with your data source, eg it returned zero rows.
I use a multi step approach:
1) Remove all links to consolidated elements
vParent = elpar(vDim,vElem,1) ;
WHILE( vParent @<> '' );
dimensionelementcomponentdelete(vDim,vParent,vElem) ;
# After deletion and parents shuffle down so what was
# parent number 2 is now parent number 1.
vParent = elpar(vDim,vElem,1) ;
END ;
2) Update Dim with new consolidation links using whatever process you use now, but removing the DimensionDeleteAllElements
3) Link any elements that don't have parents, apart from the top level element (store this in a reference cube), to an Orphans consolidation. Your dimension should look like:
All Products
Prod Cat A
Product A1
Product Cat B
Product B1
Product B2
zProduct Orphans
Product C1
IF( elparn(vDim,vElem ) = 0 ) ;
dimensionelementcomponentadd(vDim,vOrphaned,vElem,1) ;
ENDIF ;
It is relatively easy to then add a sheet to your daily checks spreadsheet that looks for dimensions where the elcompn of elements below the orphans consolidation is not zero. This implies that something has gone wrong in your source data and an element that used to have a parent no longer has one.
In practice there are a few more steps to the dimension update routine that I use, but the essentials are given above. Some extra things that I do, are to carry out all updates on a temp dim, so if anything goes wrong, eg the source data results in a circular hierarchy etc, then there is no risk of problems on the main dim. However, there are no right answers when it comes to updating dimensions. It all depends on the particular requirements. Using temp dims slows down dim updates but increases reliability. Which is best will depend on how important fast dim updates are.
Implied in the method above is that the update will never delete elements. All elements whether base level or consolidated are retained. If they arrive in the orphans consolidation then it is up to you to decide whether to delete them or not. In the case of base level elements you should always check whether there is any historical data against them. People are often inclined to only bother about the latest hierarchy and forget that the system might still have to reproduce the reports from 2 years ago, even though, eg that branch has since closed and isn't needed in the latest hierarchy. However, in the case of orphaned consolidated level elements you might prefer to delete them automatically. However, there is a risk in doing this, where they have perhaps ended up as orphans because of an error in the source data.
Regards
Paul Simon