TI and view which based on dynamic subset = error

Post Reply
EP_explorer
Regular Participant
Posts: 221
Joined: Sat Dec 04, 2010 2:35 pm
OLAP Product: PAL
Version: 2.0.9
Excel Version: 2016

TI and view which based on dynamic subset = error

Post 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?
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: TI and view which based on dynamic subset = error

Post by jim wood »

I'm not 100% certain I get what you mean. Can't you just use the SubsetGetElementName?
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
EP_explorer
Regular Participant
Posts: 221
Joined: Sat Dec 04, 2010 2:35 pm
OLAP Product: PAL
Version: 2.0.9
Excel Version: 2016

Re: TI and view which based on dynamic subset = error

Post 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|
EP_explorer
Regular Participant
Posts: 221
Joined: Sat Dec 04, 2010 2:35 pm
OLAP Product: PAL
Version: 2.0.9
Excel Version: 2016

Re: TI and view which based on dynamic subset = error

Post 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. ((
EP_explorer
Regular Participant
Posts: 221
Joined: Sat Dec 04, 2010 2:35 pm
OLAP Product: PAL
Version: 2.0.9
Excel Version: 2016

Re: TI and view which based on dynamic subset = error

Post 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.
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

Re: TI and view which based on dynamic subset = error

Post 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.
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
kpk
MVP
Posts: 214
Joined: Tue Nov 11, 2008 11:57 pm
OLAP Product: TM1, CX
Version: TM1 7x 8x 9x 10x CX 9.5 10.1
Excel Version: XP 2003 2007 2010
Location: Hungary

Re: TI and view which based on dynamic subset = error

Post 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' );
Best Regards,
Peter
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: TI and view which based on dynamic subset = error

Post 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.
"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.
lotsaram
MVP
Posts: 3706
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: TI and view which based on dynamic subset = error

Post 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.
Post Reply