Using EXPAND()

Post Reply
ChrisDixon
Posts: 2
Joined: Wed May 26, 2010 8:30 am
OLAP Product: TM1
Version: 9.0
Excel Version: 2003

Using EXPAND()

Post by ChrisDixon »

I am unsuccessfully trying to use the EXPAND function to run dynamic code. A simplified version of the code is:

Code: Select all

strNewCube = 'NewCube';
strDimList = '''Dim1'', ''Dim2'', ''Dim3''';
CUBECREATE(strNewCube, EXPAND('%strDimList%'));
The returned error is 'Not enough arguments'

Hopefully somebody can help. I don't even know if what I am trying to do is possible
jstrygner
MVP
Posts: 195
Joined: Wed Jul 22, 2009 10:35 pm
OLAP Product: TM1
Version: 9.5.2 FP3
Excel Version: 2010

Re: Using EXPAND()

Post by jstrygner »

Did not do any testing here, but it seems obvious for me that you cannot put a string variable with some commas in it and expect CubeCreate (or any other function) to interpret it as a list of arguments.

I think in your particular case the problem is, CubeCreate tries to create a NewCube cube that is supposed to have only one dimension: 'Dim1', 'Dim2', 'Dim3', which is impossible, even if such a dimension would exist (you need at least two dimensions to create a cube).

HTH
ChrisDixon
Posts: 2
Joined: Wed May 26, 2010 8:30 am
OLAP Product: TM1
Version: 9.0
Excel Version: 2003

Re: Using EXPAND()

Post by ChrisDixon »

Thanks for your reply.

I ended up using 15 if statements and variables to create cubes with 2 - 16 dimensions instead. It isn't very elegant, but it works
Post Reply