Page 1 of 1
TI and view which based on dynamic subset = error
Posted: Mon Feb 21, 2011 10:19 am
by EP_explorer
I wanted to create next thing.
I have 3 cubes. In Cube 1_Input I calculate current version, in Cube 1_Input_versions I store versions, and also I have Cube Pick_Versions where I choose versions.
Cube 1_Input contains 3 dimensions:
1. Items
2. Numbers
3. 1_Input
Cube 1_Input_versions contains 4 dimensions:
1. Items
2. Numbers
3. Versions
4. 1_Input
I wrote TI process which copy data from Cube 1_Input to Cube 1_Input_versions using version which chosen in Cube Pick_Versions. But I can't create reverse TI process which returns data from Cube 1_Input_versions to Cube 1_Input using version which chosen in Cube Pick_Versions.
I tried to do next thing. I created Subset Current_Version which based on MDX and return Current_Version for dimension Versions (which was picked in Cube Pick_Versions)
For example dimension Versions contains 5 Versions:
Version 1
Version 2
Version 3
Version 4
Version 5
And Version 2 is picked in Cube Pick_Versions - Subset Current_Version contains Version 2. So I create View Default in Cube 1_Input_versions which contains Dimensions Items, Numbers, Subset Current Version and Dimension 1_Input
I create TI process with Data Source 1_input_Versions->Default
In prolog:
CubeClearData( '1_Input' );
In Data:
m=CellIsUpdateable('1_input',Items,Numbers,V3);
if(m=1);
if (VALUE_IS_STRING=1);
CellPutS(SVALUE,'1_input',Items,Numbers,V3);
else;
CellPutN(NVALUE, '1_input',Items,Numbers,V3);
endif;
endif;
V3 - is variable for 1_Input dimension
So. When I launch this TI process at first - it works. But when I change version in cube PickVersion Windows shows that TM1S made a mistake and close it. So I have to start TM1 server again.
Can anybody gives any advice?
Re: TI and view which based on dynamic subset = error
Posted: Mon Feb 21, 2011 11:47 am
by jim wood
I'm not 100% certain I get what you mean. Can't you just use the SubsetGetElementName?
Re: TI and view which based on dynamic subset = error
Posted: Mon Feb 21, 2011 1:15 pm
by EP_explorer
No I didn't use this function (SubsetGetElementName) in TI process
This Subset was created in Subset Editor using MDX
Filter({TM1FILTERBYLEVEL( {TM1SUBSETALL( [Versions] )}, 0)},
[Current_Version].(Vers_Znach.Vers_Znach)<>'')
(MDX expression doesn't contain PickVersion Cube because Current_Version Cube has rule to Cube PickVersion - but it doesn't matter for the question how I created MDX expression as I think). But if you are interseted here Current_Version Cube Data, when in Cube PickVersion chosen Version 2
Versions |Vers_Znach
Vesrion 1|
Version 2|Version 2
Version 3|
Version 4|
Version 5|
Re: TI and view which based on dynamic subset = error
Posted: Mon Feb 21, 2011 6:18 pm
by EP_explorer
Also I tried to write Prolog like
CubeClearData( '1_Input' );
IF(ViewExists('1_Input_Versions', 'test')=1);
ViewDestroy('1_Input_Versions', 'test');
endif;
IF(SubsetExists('Versions', 'test')=1);
SubsetDestroy('Versions', 'test');
endif;
SubsetCreate('Versions', 'test');
#Insert Version from dynamic subset which contains current version to new subset
Version_name=SubsetGetElementName('Versions', 'Current_Version', 1);
SubsetElementInsert('Versions', 'test', Version_name, 1);
ViewCreate('1Input_Versions', 'test');
ViewSubsetAssign('1_Input_Versions', 'test', 'Versions', 'test');
ViewRowDimensionSet('1_Input_Versions', 'test', '1_STND_input', 1);
ViewColumnDimensionSet('1_Input_Versions', 'test', 'Numbers', 1);
ViewTitleDimensionSet('1_Input_Versions', 'test', 'Items');
ViewTitleDimensionSet('1_Input_Versions', 'test', 'Versions');
DatasourceCubeview='test';
And again - it works one time, after that I change version in Cube PickVersion - launch TI process - Windows shows error of tm1s and close program. ((
Re: TI and view which based on dynamic subset = error
Posted: Wed Feb 23, 2011 11:41 am
by EP_explorer
Funny but I've found the reason.
It is quite strange but may be it will be helpful for somebody
function CellPutN doesn't work (lead to the Windows error) if function CubeClearData with the same Cube has been put before it.
when I change CubeClearData to VIEWZEROOUT TI process works.
Re: TI and view which based on dynamic subset = error
Posted: Wed Feb 23, 2011 3:09 pm
by Steve Vincent
Where have you got CubeClearData from? I've just checked in my TI help files for 9.5 and there is no mention of that function, which might explain why it worked when you replaced it with viewzeroout.
Re: TI and view which based on dynamic subset = error
Posted: Wed Feb 23, 2011 4:20 pm
by kpk
Steve Vincent wrote:Where have you got CubeClearData from? I've just checked in my TI help files for 9.5 and there is no mention of that function, which might explain why it worked when you replaced it with viewzeroout.
Hi,
You can find it in both the 9.5.0 and 9.5.1 reference guide:
http://publib.boulder.ibm.com/infocente ... 78211.html
CubeClearData
This is a TM1® TurboIntegrator function, valid only in TurboIntegrator processes.
This clears all of the data in a cube.
This function is much faster than doing an operation such as creating a view to cover the entire cube, and then doing a ViewZeroOut() to zero out the entire cube.
Note: This call just deletes the cube data, it does not delete and re-create the cube itself. This has implications when sandboxes are used. If a cube is deleted and then re-created any sandboxes a user may have will be discarded, since the cube against which those sandboxes were created was deleted (even though a cube may have been re-created with the same name). If however the CubeClearData() call is used, the sandbox data will still be considered valid, since the cube against which the sandbox was created continues to exist.
Syntax
CubeClearData( name-of-cube-as-string );
Arguments
The name of the cube to clear, as a string.
Example
CubeClearData( 'expense' );
Re: TI and view which based on dynamic subset = error
Posted: Wed Feb 23, 2011 9:22 pm
by Alan Kirk
Steve Vincent wrote:Where have you got CubeClearData from? I've just checked in my TI help files for 9.5 and there is no mention of that function, which might explain why it worked when you replaced it with viewzeroout.
As Peter mentioned they put it in the reference guide, but forgot to update the TI guide with it; it doesn't even appear in the keywords list.
Re: TI and view which based on dynamic subset = error
Posted: Wed Feb 23, 2011 10:07 pm
by lotsaram
EP_explorer wrote:Funny but I've found the reason.
It is quite strange but may be it will be helpful for somebody
function CellPutN doesn't work (lead to the Windows error) if function CubeClearData with the same Cube has been put before it.
when I change CubeClearData to VIEWZEROOUT TI process works.
Are you saying that the server crashes if you try a CellPutN in the Prolog to a cube that you have previously cleared with CubeClearData in the Prolog? If so you should raise a PMR with IBM and report this as a bug.