Creating Private Subsets using Subdefine

Post Reply
Maianbarian
Posts: 3
Joined: Fri Oct 02, 2015 12:23 am
OLAP Product: Perspectives
Version: 10-2
Excel Version: 2010

Creating Private Subsets using Subdefine

Post by Maianbarian »

Hi All,

I'm building some reporting in excel using perspectives which requires custom subsets so that I can consolidate data in ways outside of the official hierarchies. I don't have write access to the server so I can't create any public subsets.

My workaround has been to create some private subsets, which work fine on my machine, but of course when anyone else tries to run my reports they get errors. A bit of googling, led me to the Subdefine function, which should be able to create a subset from a range in Excel, but I can't for the life of me get it to work. The code I'm using to test creation of a subset is:

Code: Select all

Sub createsubsets()

bResult = Application.Run("SUBDEFINE", "TM1_Financials:All GL:Account", "My Test Subset", ActiveSheet.Range("A2:A3"))
Debug.Print bResult


End Sub
The server I'm accessing is called TM1_Financials, the cube is All GL and the dimension is Account. Whenever I run the code, bResult comes back as False. I'm sure I'm missing something simple, but the user docs for Subdefine aren't particularly enlightening :)
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: Creating Private Subsets using Subdefine

Post by tomok »

Why do you think that creating a subset using Subdefine is going to let you create a public subset? It's a security thing, not a user interface thing.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
Maianbarian
Posts: 3
Joined: Fri Oct 02, 2015 12:23 am
OLAP Product: Perspectives
Version: 10-2
Excel Version: 2010

Re: Creating Private Subsets using Subdefine

Post by Maianbarian »

I'm not trying to create a public subset, I want to embed a macro in the report that will create private subsets on the user's PC.
Alan Kirk
Site Admin
Posts: 6667
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: Creating Private Subsets using Subdefine

Post by Alan Kirk »

Maianbarian wrote:I'm not trying to create a public subset, I want to embed a macro in the report that will create private subsets on the user's PC.
To be fair I read your question the same way.

I can't look at your question just at the moment but that first argument doesn't look right to me. That should be the dimension which will be in the format ServerName:DimName. Instead you have two colons in the expression that you've entered. Specifically TM1_Financials:All GL:Account

There's no way that would be right.
"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.
Maianbarian
Posts: 3
Joined: Fri Oct 02, 2015 12:23 am
OLAP Product: Perspectives
Version: 10-2
Excel Version: 2010

Re: Creating Private Subsets using Subdefine

Post by Maianbarian »

Thanks Alan, I see what I was doing wrong. I thought that I would have to specify the cube that I was pulling the data from, but turns out that I don't. Once I dropped the cube "All GL" from the first argument the function works like a charm. Appreciate the help :)

FYI, my now working code reads:

Code: Select all

Sub createsubsets()

bResult = Application.Run("SUBDEFINE", "TM1_Financials:Account", "My Test Subset", ActiveSheet.Range("A2:A3"))
Debug.Print bResult


End Sub
Post Reply