企业绩效管理网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 586|回复: 8

TI and view which based on dynamic subset = error

[复制链接]

71

主题

366

帖子

519

积分

高级会员

Rank: 4

积分
519
QQ
发表于 2014-3-15 06:33:28 | 显示全部楼层 |阅读模式
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?
回复

使用道具 举报

58

主题

393

帖子

540

积分

高级会员

Rank: 4

积分
540
QQ
发表于 2014-3-15 07:34:06 | 显示全部楼层
I'm not 100% certain I get what you mean. Can't you just use the SubsetGetElementName?
回复 支持 反对

使用道具 举报

96

主题

400

帖子

617

积分

高级会员

Rank: 4

积分
617
QQ
发表于 2014-3-15 08:11:40 | 显示全部楼层
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|
回复 支持 反对

使用道具 举报

85

主题

408

帖子

596

积分

高级会员

Rank: 4

积分
596
QQ
发表于 2014-3-15 08:28:14 | 显示全部楼层
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. ((
回复 支持 反对

使用道具 举报

79

主题

412

帖子

581

积分

高级会员

Rank: 4

积分
581
QQ
发表于 2014-3-15 08:32:45 | 显示全部楼层
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.
回复 支持 反对

使用道具 举报

83

主题

388

帖子

565

积分

高级会员

Rank: 4

积分
565
QQ
发表于 2014-3-15 09:05:53 | 显示全部楼层
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.
回复 支持 反对

使用道具 举报

66

主题

382

帖子

540

积分

高级会员

Rank: 4

积分
540
发表于 2014-3-15 09:32:44 | 显示全部楼层
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:


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' );

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 支持 反对

使用道具 举报

85

主题

433

帖子

616

积分

高级会员

Rank: 4

积分
616
QQ
发表于 2014-3-15 09:37:18 | 显示全部楼层
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.
回复 支持 反对

使用道具 举报

70

主题

353

帖子

524

积分

高级会员

Rank: 4

积分
524
QQ
发表于 2014-3-15 10:33:05 | 显示全部楼层
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.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|企业绩效管理网 ( 京ICP备14007298号   

GMT+8, 2020-10-20 20:06 , Processed in 0.147716 second(s), 12 queries , Memcache On.

Powered by Discuz! X3.1 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表