HierarchySize Function

Post Reply
User avatar
Steve Rowe
Site Admin
Posts: 2410
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

HierarchySize Function

Post 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?
Technical Director
www.infocat.co.uk
BrianL
MVP
Posts: 264
Joined: Mon Nov 03, 2014 8:23 pm
OLAP Product: TM1
Version: 9.5.2 10.1 10.2 PA2
Excel Version: 2016

Re: HierarchySize Function

Post by BrianL »

Have you tried passing 'DImensionName:HierarchyName' into DimSiz?
st2000
Posts: 62
Joined: Mon Aug 15, 2016 8:48 am
OLAP Product: TM1 (Windows) & SSAS 2014 Ent.
Version: 10.2.0 FP3
Excel Version: Excel 2013
Location: Hamburg, DE, EU
Contact:

Re: HierarchySize Function

Post 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...
-----------------------------------
Best regards,
Stefan
David Usherwood
Site Admin
Posts: 1453
Joined: Wed May 28, 2008 9:09 am

Re: HierarchySize Function

Post 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)
User avatar
Steve Rowe
Site Admin
Posts: 2410
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: HierarchySize Function

Post 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...
Technical Director
www.infocat.co.uk
Post Reply