Dimension Worksheet Function

Post Reply
User avatar
Eric
MVP
Posts: 373
Joined: Wed May 14, 2008 1:21 pm
OLAP Product: TM1
Version: 9.4
Excel Version: 2003
Location: Chicago, IL USA

Dimension Worksheet Function

Post by Eric »

I thought there was a function where I could reference an dimension index numbers and I would be able to retrieve the dimension name. Maybe because it is monday, but I can't seem to find it.
Regards,
Eric
Blog: http://tm1-tipz.blogspot.com
Articles: http://www.google.com/reader/shared/use ... /label/TM1


Production: 32 bit 9.0 SP2, Windows 2000 Advanced Server. Web: 32 bit 9.0 SP2, Windows 2000 Server. Excel 2003
User avatar
Alan Kirk
Site Admin
Posts: 6606
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Dimension Worksheet Function

Post by Alan Kirk »

Eric wrote:I thought there was a function where I could reference an dimension index numbers and I would be able to retrieve the dimension name. Maybe because it is monday, but I can't seem to find it.
Are you thinking of TabDim, perhaps?
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
Paul Segal
Community Contributor
Posts: 306
Joined: Mon May 12, 2008 8:11 am
OLAP Product: TM1
Version: TM1 11 and up
Excel Version: Too many to count

Re: Dimension Worksheet Function

Post by Paul Segal »

=DIMNM(Dimension, Index, Alias) will return the company name.
Paul
User avatar
Alan Kirk
Site Admin
Posts: 6606
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Dimension Worksheet Function

Post by Alan Kirk »

Eric wrote:I thought there was a function where I could reference an dimension index numbers and I would be able to retrieve the dimension name.
Paul Segal wrote:=DIMNM(Dimension, Index, Alias) will return the company name.
Paul, I think you're thinking of an element name rather than a dimension name.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
Paul Segal
Community Contributor
Posts: 306
Joined: Mon May 12, 2008 8:11 am
OLAP Product: TM1
Version: TM1 11 and up
Excel Version: Too many to count

Re: Dimension Worksheet Function

Post by Paul Segal »

Ah. I'll get my coat...
User avatar
Eric
MVP
Posts: 373
Joined: Wed May 14, 2008 1:21 pm
OLAP Product: TM1
Version: 9.4
Excel Version: 2003
Location: Chicago, IL USA

Re: Dimension Worksheet Function

Post by Eric »

Maybe I should ask a different question.

What is the best way to audit your DIM so you can clean out the garbage DIMs you are no longer using?

I was going to exract a list and then bounce each one off every cube.
Regards,
Eric
Blog: http://tm1-tipz.blogspot.com
Articles: http://www.google.com/reader/shared/use ... /label/TM1


Production: 32 bit 9.0 SP2, Windows 2000 Advanced Server. Web: 32 bit 9.0 SP2, Windows 2000 Server. Excel 2003
ScottW
Regular Participant
Posts: 152
Joined: Fri May 23, 2008 12:08 am
OLAP Product: TM1 CX
Version: 9.5 9.4.1 9.1.4 9.0 8.4
Excel Version: 2003 2007
Location: Melbourne, Australia
Contact:

Re: Dimension Worksheet Function

Post by ScottW »

Hi Eric,

In the old TM1 recommended practices look up "Documenting_Dimension_Usage_by_Cube" - both TI and rules approaches are explained.

To improve on things a little I would recommend rather than using the control dims in the audit cube creating a replica of }Cubes and }Dimensions with a top level consolidation "All Cubes" and "All Dims" as this will make analysis easier.
Cheers,
Scott W
Cubewise
www.cubewise.com
User avatar
Alan Kirk
Site Admin
Posts: 6606
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Dimension Worksheet Function

Post by Alan Kirk »

ScottW wrote:Hi Eric,

In the old TM1 recommended practices look up "Documenting_Dimension_Usage_by_Cube" - both TI and rules approaches are explained.

To improve on things a little I would recommend rather than using the control dims in the audit cube creating a replica of }Cubes and }Dimensions with a top level consolidation "All Cubes" and "All Dims" as this will make analysis easier.
Would I be correct in guessing that this is an archival copy that you have?

A search of the "Proven Practices" site that Eric located in this thread:

http://forums.olapforums.com/viewtopic.php?f=3&t=354

discloses only 8 documents[1] when you search for "TM1", none of which are that one.

[1] When it finally comes up. Honest to glub, I can't believe how slow Cognos Web sites are compared to... pretty much any other web site I visit.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
User avatar
Alan Kirk
Site Admin
Posts: 6606
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Dimension Worksheet Function

Post by Alan Kirk »

Eric wrote:Maybe I should ask a different question.

What is the best way to audit your DIM so you can clean out the garbage DIMs you are no longer using?

I was going to exract a list and then bounce each one off every cube.
I don't know if this is the BEST way (indeed it probably isn't), but this is a little quick & dirty app that I knocked together in between doing other stuff this morning. (Which means that it's not fully tested (though I tested it on my own server), and if it falls over and dribbles on you don't blame me.)

It generates three sheets; a list of cubes, a list of dimensions, and a list of the dimensions used in each cube. Rather than getting the cube or dim list from the server, it does it from the data directory. The list of dims in each cube, it gets from the server. That means that you need to have access to the data folder and be logged on.

Also it uses the file system object (which typically I don't, since it's a slug compared to the Windows API), but for something cheap and dirty it works well enough. However it does mean that you need to have the MS scripting library available. (Some more paranoid IT departments apparently block it, but that's not common.)

I discovered one flaw when I ran it the first time; if a dim is used in its own element attributes cube, it wouldn't be flagged as being an orphan. By default the app no longer looks at attribute cube usage, but you can change that behaviour on the control sheet.

You can also re-sort the dims in cube sheet to see the cubes that each dim is used in.

Enjoy if you want it, ignore it if you don't...
Attachments
DimChecker.xls
(78 KiB) Downloaded 455 times
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

Re: Dimension Worksheet Function

Post by Steve Vincent »

I take no credit for this, its something i borrowed from Garry when i moved jobs :) It checks all the non-control cubes and dims and reports info against them including how many cubes they are used in.

TI with no data source, all code in the prolog;

Code: Select all


FileOut='\\path\to\output\file\Dim Analysis.csv';

count=1;

DimTot=DIMSIZ('}Dimensions');
ASCIIOutput(FileOut, 'Dimension', 'No of Data Points','Number of elements','Consolidated Data Points', 'No of attached cubes');
ASCIIOutput(FileOut, ' ');



While(count<=DimTot);
  dimension=dimnm('}Dimensions',Count);
   IF(SUBST(dimension,1,1)@='}');
    Itemskip;
   Endif;

   Cubecount=1;
   Cubatt=0;    
    While(Cubecount <= dimsiz('}Cubes'));
      cube=dimnm('}Cubes', cubecount);
      cubeno=1;

        If(SUBST(cube,1,1)@<>'}');
        While(cubeno<=16);
           If(dimension@=tabdim(cube,cubeno));
            Cubatt=Cubatt+1;
           Endif;
          Cubeno=Cubeno+1;
         End;
        Endif;
        Cubecount=cubecount+1;
       End;

  NoofCubes=TRIM(STR(Cubatt,2,0));
  NoofElem=TRIM(STR(DIMSIZ(dimension),5,0));
  Elemcount=0;
  Count2=1;
    While(Count2<=DIMSIZ(dimension));
     Elem=DIMNM(dimension,count2);
      If(ELLEV(dimension,Elem)=0);
       elemcount=elemcount+1;
      Endif;
     Count2=Count2+1;
    End;
   highlvlcount=TRIM(STR((DIMSIZ(dimension)-elemcount),5,0));
   elemstr=TRIM(STR(elemcount,5,0));
  ASCIIOutput(FileOut, dimension, Noofelem, elemstr, highlvlcount, NoofCubes);
 count=count+1;
End;
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
User avatar
Martin Ryan
Site Admin
Posts: 1988
Joined: Sat May 10, 2008 9:08 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: Dimension Worksheet Function

Post by Martin Ryan »

Steve Vincent wrote:I take no credit for this, its something i borrowed from Garry when i moved jobs :)
Speaking of Garry, what's happened to him? Haven't heard a peep out of him since his post about not being able to find TM1 people to work in the North West. Did he find you, Steve, then give you the baby and move on to other things?

Martin
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
User avatar
Eric
MVP
Posts: 373
Joined: Wed May 14, 2008 1:21 pm
OLAP Product: TM1
Version: 9.4
Excel Version: 2003
Location: Chicago, IL USA

Re: Dimension Worksheet Function

Post by Eric »

Everyone. Thanks! I expected this to be a little simpler, but you have provided enough for me to do what I need in the short term. I will explore a long term goal when I have time.

OLAPFForumsMemeber = 'Rock';
Regards,
Eric
Blog: http://tm1-tipz.blogspot.com
Articles: http://www.google.com/reader/shared/use ... /label/TM1


Production: 32 bit 9.0 SP2, Windows 2000 Advanced Server. Web: 32 bit 9.0 SP2, Windows 2000 Server. Excel 2003
User avatar
Steve Rowe
Site Admin
Posts: 2417
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: Dimension Worksheet Function

Post by Steve Rowe »

A simple wks that dose this.

Change the server name
Copy the row and column headers across according to how many cubes and dims you have.
Change the Or statment in the formula for the cube with the maximum number of dimensions.

Will take a while to calculate, with big pause at the beginnig.

Values >0 in column B indicate dimensions used in cubes.


HTH
Attachments
dimcheck.zip
(2.45 MiB) Downloaded 411 times
Technical Director
www.infocat.co.uk
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

Re: Dimension Worksheet Function

Post by Steve Vincent »

Other way around, he joined us, took over when my previous boss left then i left leaving him with the baby :lol: He's still around tho, just a very busy man
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
Post Reply