Page 1 of 1
HierarchySize Function
Posted: Wed Aug 23, 2017 3:04 pm
by Steve Rowe
Anyone seen the equivalent of DimSiz for Hierarchies?
HierarchySize or HierarchySiz doesn't compile and I can't see any other likely candidates.
Anyone spotted the function?
Re: HierarchySize Function
Posted: Wed Aug 23, 2017 3:17 pm
by BrianL
Have you tried passing 'DImensionName:HierarchyName' into DimSiz?
Re: HierarchySize Function
Posted: Wed Aug 23, 2017 4:07 pm
by st2000
In the PA docs there are many functions supporting the new hierarchy feature, maybe this could do the job?
Code: Select all
HierarchySubsetGetSize(DimName, HierName, SubsetName);
As far as there is a subset ALL in place for the regraded hierarchy...
Re: HierarchySize Function
Posted: Thu Aug 24, 2017 5:18 pm
by David Usherwood
Digging in somewhat it turns out that DIMSIZ is a rules function (which can be used in TI like almost all of them) - clue is that it is short and cryptic.
This can be done with Marius Wirtz' TM1py libraries:
Code: Select all
from TM1py.Services import TM1Service
with TM1Service(address='', port=8045, user='', password='', ssl=True) as tm1:
dim_name = 'SDK.Geography'
dimension = tm1.dimensions.get(dimension_name=dim_name)
# iterate through hierarchies
for hierarchy in dimension:
print(hierarchy.name, len(hierarchy))
(Updated 25/08 - no need for an explicit loop)
Re: HierarchySize Function
Posted: Wed Aug 30, 2017 5:41 pm
by Steve Rowe
BrianL wrote: ↑Wed Aug 23, 2017 3:17 pm
Have you tried passing 'DImensionName:HierarchyName' into DimSiz?
Thanks Brain, I can confirm that DimSiz ('DImensionName:HierarchyName' ) returns the correct information...