Page 1 of 1

Using EXPAND()

Posted: Fri Oct 01, 2010 8:14 am
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

Re: Using EXPAND()

Posted: Tue Oct 05, 2010 11:06 am
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

Re: Using EXPAND()

Posted: Wed Oct 20, 2010 10:49 am
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