Hierarchy as a Datasource

Post Reply
User avatar
PavoGa
Community Contributor
Posts: 227
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0
Excel Version: 2013
Location: Cleveland, Tennessee

Hierarchy as a Datasource

Post by PavoGa » Tue Sep 11, 2018 10:20 pm

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: 3107
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TM1, CX
Version: TM1 10.2.2 PA 2.0x
Excel Version: 2010 2013 365
Location: Switzerland

Re: Hierarchy as a Datasource

Post by lotsaram » Wed Sep 12, 2018 4:47 am

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
Community Contributor
Posts: 227
Joined: Thu Apr 18, 2013 6:59 pm
OLAP Product: TM1
Version: 10.2.2 FP7, PA2.0
Excel Version: 2013
Location: Cleveland, Tennessee

Re: Hierarchy as a Datasource

Post by PavoGa » Wed Sep 12, 2018 12:22 pm

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