Page 1 of 1

DimensionSortOrder issue

Posted: Tue Mar 24, 2015 1:51 pm
by elee123
Hi ALL,
Has anyone encountered any issue when doing DimensionSortOrder( 'dimname', 'ByInput', 'ascending', 'ByHierarchy', 'Ascending') in Epilog?
I ran a simple TI that updates a dimension elements & consolidated ones with the Oracle SQL as data source. It would run fine without the DimensionSortOrder function in Epilog, but when the function is on, I'd get the following error:
"ABC","","XYZ","AFF", Data Source line (1) Error: MetaData procedure line (8): Unknown error response from obtabCellWriteStatusGet() = 140.

Has anyone seen an error like this?
Thank you.

Re: DimensionSortOrder issue

Posted: Tue Mar 24, 2015 1:57 pm
by declanr
It would be surprising if the 2 are related; especially as the error is on the metadata tab and TM1 doesn't really look as far forward as the epilog until it needs to.
Also I seem to recall dimensionsortorder not working on the epilog anyway as TM1 considers it a metadata function (therefore a prolog or metadata tab function); I don't think it broke anything though - it just didn't do anything.

Re: DimensionSortOrder issue

Posted: Tue Mar 24, 2015 2:07 pm
by elee123
Should we be running DimensionSortOrder in metadata? Isn't it better to wait until the process finish scanning all the records in sql then call the function in epilog?
I've got DimensionElementInsertDirect in Metadata section, does anyone see a conflict between this 'direct' function and 'sort' function?

Re: DimensionSortOrder issue

Posted: Tue Mar 24, 2015 3:04 pm
by tomok
To the best of my recollection, at least for older versions of TM1, metadata functions are ignored when put in the epilog of a process. The bigger question is why would you be setting the sort order of a dimension in the epilog of a process. By the time you get to the epilog, all the dimension updates have already happened so changing the sort order would only affect future changes to the dimension. The documentation for the DimensionSortOrder states:
DimensionSortOrder sets properties for a dimension; the dimension is not actually sorted until it is saved on the server
So, setting the sort order does not actually sort a dimension, it just changes the setting (which is actually just a value in the }CubeProperties cube) so that THE NEXT TIME THE DIMENSION IS SAVED IT WILL BE SORTED. The save you are looking for has already happened once you get to the epilog.

Re: DimensionSortOrder issue

Posted: Wed Mar 25, 2015 11:07 pm
by paulsimon
Hi

You would be better putting the settings directly into the }DimensionProperties cube. You will find elements there related to the 4 sort settings. That is what I always do these days as DimensionSortOrder does not work well. It must be used in the Prolog. It only works when the dimension is empty. By comparison putting the sort requirements directly into }DimensionProperties works whenever the dimension is updated.

Regards

Paul Simon