Hierarchy as a Datasource

Post Reply
User avatar
PavoGa
MVP
Posts: 616
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0.9.1
Excel Version: 2013 PAW
Location: Charleston, Tennessee

Hierarchy as a Datasource

Post by PavoGa »

Quick question: can a dimension hierarchy be used as a datasource?

Tried it by creating a hierarchy subset and then the following:

Code: Select all

sMDX = 'TM1FILTERBYLEVEL(TM1SUBSETALL( [Accounts Master].[Statistical Categories]), 0)';

HierarchySubsetCreate(dimAccountsMaster, hierStatisticalCategories, subStatisticalCategories, 1);
HierarchySubsetMDXSet(dimAccountsMaster, hierStatisticalCategories, subStatisticalCategories, sMDX);

DataSourceType = 'SUBSET';
# this does not work either: DataSourceNameForServer = dimAccountsMaster;
DataSourceNameForServer = hierStatisticalCategories;
DataSourceDimensionSubset = subStatisticalCategories;
If I am not missing something here in setting up the datasource and hierarchies cannot be used directly as a datasource, then the only choice is to create a temporary dimension with the elements in the hierarchy subset?

Hope I'm just missing something because I'm just diving into using the hierarchy functionality.
Ty
Cleveland, TN
lotsaram
MVP
Posts: 3651
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Hierarchy as a Datasource

Post by lotsaram »

It works just fine. The trick is to set the hierarchy as the dimension source with DatasourceNameForServer variable with the hierarchy's "full name" as it appears in }Dimensions. You can't use just the hierarchy name and have to concatenate the dimension name with colon as hierarchy names aren't unique (e.g. "Leaves").

E.g.
DatasourceNameForServer = ‘dim:hier’;

Or as per your code above it would be
DataSourceNameForServer = dimAccountsMaster |':'| hierStatisticalCategories;
DataSourceDimensionSubset = subStatisticalCategories;
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
User avatar
PavoGa
MVP
Posts: 616
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0.9.1
Excel Version: 2013 PAW
Location: Charleston, Tennessee

Re: Hierarchy as a Datasource

Post by PavoGa »

Thank you, Lotsaram. That took care of it.

:oops: I should have tried that. I'd seen the syntax for that in other places and just did not connect the dots on it.
Ty
Cleveland, TN
Post Reply