How to find subsets used in TM1 View

Post Reply
late.vaibhav
Posts: 25
Joined: Mon Dec 09, 2013 1:00 pm
OLAP Product: tm1
Version: 9.5.2, 10.2.2
Excel Version: 2007 2010
Location: India
Contact:

How to find subsets used in TM1 View

Post by late.vaibhav »

Hi,

I need to find the subsets which are used in the TM1 views of the cube.
Is there any way to find it through TI process.

Thanks & Rgards
Vaibhav Late
escape18in
Posts: 26
Joined: Tue Feb 03, 2015 10:22 am
OLAP Product: IBM Cognos BI
Version: 10.2
Excel Version: Excel 2010

Re: How to find subsets used in TM1 View

Post by escape18in »

open views VUE file in TI as text source, you will find two column text file, than whatever the value of column second with column one value "6" is subset used in your view.column one value "7" is all dimension used. hope this will answer your query.
TrevorGoss
Community Contributor
Posts: 217
Joined: Thu Aug 15, 2013 9:05 am
OLAP Product: TM1
Version: 10.2.1.1
Excel Version: 14.0.6129.5000

Re: How to find subsets used in TM1 View

Post by TrevorGoss »

I had a brief attempt at this and just to let you know, if the view that contains the .vue folder has a dimension that does not use a subset, the number 6 will be alongside All, because it is using all the elements.

I am going to try a more comprehensive TI and see what I can come up with, because I need something like this as well.

Thanks.

Trevor.
declanr
MVP
Posts: 1817
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: How to find subsets used in TM1 View

Post by declanr »

TrevorGoss wrote:I had a brief attempt at this and just to let you know, if the view that contains the .vue folder has a dimension that does not use a subset, the number 6 will be alongside All, because it is using all the elements.

I am going to try a more comprehensive TI and see what I can come up with, because I need something like this as well.

Thanks.

Trevor.
When you see "6, ALL" it is actually a system derived subset that exists for the dimension - the more challenging part you will have to contend with is where a manually picked list of elements have been saved within the view in which case from memory you don't see a 6 at all but you will see your list of elements (I also seem to recall but could be wrong that some versions would list elements and others would list index numbers or perhaps its just a show of both.)

To the OP though; you need to take what has been said on board but it does mean calling a sub process as to your actual question there is no nice simple TI function to just give you a list - your sub process can stick out the info to a txt file or into a temp dim etc for lookup.

The below code is a quick idea but I haven't tested it in action (so expect syntax errors - I don't think I have ever written a block of code without a missing comma or something to start with), I did something like this previously and remember incorporating flags since you can find in the case of your last dimension being a manual list of elements it is likely/possible that you will still see another 6 further down but it won't relate to a subset and instead is just part of the general GUFF that populates these files and should instead be ignored.
The subsetexists part would mean that it will only output a file of which dimensions have a user defined subset (or TI defined or possibly auto Perf Mod defined... just not the ALL subset essentially or random lists of elements.)

Code: Select all

If ( vCol1 @= '7' );
	iDimFlag = '1';
	sDim = vCol2;
ElseIf ( ( iDimFlag @= '1' ) & ( vCol1 @='6' ) & ( SubsetExists ( sDim, vCol2 ) =1 ) );
	AsciiOutput ( <myfile>, sDim, vCol2 );
	sDim = '';
	iDimFlag = '0';
EndIf;
Note that you would need to make sure that iDimFlag is initially set to '0' in the prolog & sDim is initially set to ''.

You can do pretty nifty extra work if you stick it into a temp dimension instead; when I did it previously it was part of a bigger chore of processes that ran and did a lot of system documentation for me but I rely on that less and less nowadays since such functionality is being built in to tools like PM etc.
Should point you in the right direction anyway.
Declan Rodger
User avatar
paulsimon
MVP
Posts: 808
Joined: Sat Sep 03, 2011 11:10 pm
OLAP Product: TM1
Version: PA 2.0.5
Excel Version: 2016
Contact:

Re: How to find subsets used in TM1 View

Post by paulsimon »

Hi

Parsing the .vue files might be a way to do this.

I have done it using the API.

Given that you can now call Java from TI, that might be a way to do it.

The underlying question is why you want to find out the subsets used in a view?

If your aim is to be able to create the view using TI, I have API code that lets you pick one or more Cubes, and it will then generate the TI statements necessary to create each cube if it doesn't already exist, and Ti statements to create all the Views defined on that cube.

If your aim is to find out which Views are using a Subset because you cannot delete the Subset if it is being used by a View. It is not that easy to find out which View is using it, particularly if it is a Subset on a dimension that is used in a lot of cubes, then again this is something you can do via the API. You pick the dimension, then you pick from a list of subsets (Public and Your Private Subsets). It then shows you a list of the Cubes, Views, and whether the View is Public or Private.

Using the API you could also directly read a View definition and create another similar View definition.

Regards

Paul Simon
Post Reply