企业绩效管理网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1264|回复: 6

How to create view in TI to specific elements

[复制链接]

66

主题

395

帖子

544

积分

高级会员

Rank: 4

积分
544
QQ
发表于 2014-5-11 04:00:42 | 显示全部楼层 |阅读模式
How do I create a view to limited to specific elements only? I'm creating this as part of a TI that loads that data 3 times a day daily....I need to zero out the certain elements in certain dimensions specifically date, year and measures for that date so I can refresh the data as scheduled. I have other dates for historical purporses so I don't want to miss out on that and so far I ended up creating a view that zero out all my previous data.

Code: ViewCreate('PRODUCTION_capacity','Current');

ViewTitleDimensionSet('PRODUCTION_capacity','Current','base_month_dates');
ViewTitleDimensionSet('PRODUCTION_capacity','Current','measures_machines_capacity');
ViewTitleDimensionSet('PRODUCTION_capacity','Current','base_years');

ViewTitleElementSet('PRODUCTION_capacity','Current','base_month_dates',DIMIX('base_month_dates',vDate));
ViewTitleElementSet('PRODUCTION_capacity','Current','base_years',DIMIX('base_years',vYear));
ViewTitleElementSet('PRODUCTION_capacity','Current','measures_machines_capacity',DIMIX('measures_machines_capacity','WIP DH Lots'));

ViewZeroOut('PRODUCTION_capacity','Current');

ViewDestroy('PRODUCTION_capacity','Current');

本帖子中包含更多资源

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

x
回复

使用道具 举报

57

主题

378

帖子

507

积分

高级会员

Rank: 4

积分
507
发表于 2014-5-11 05:02:37 | 显示全部楼层
Hi. You don't need to assign the dimension to titles/rows/columns etc in a zero out view. Just assign the elemenst you want to zero out to a subset that is then assigned to the zero our view. If your DIMIX('base_month_dates',vDate) is saved say as the subset CurrentMonths and this contains the elements you want to zero out then assign this to the view as below:

CubeName = 'PRODUCTION_capacity';
ViewName = 'Current' ;
ViewCreate  (CubeName, ViewName) ;

DimName = 'base_month_dates';
SubName = 'CurrentMonths';
ViewSubsetAssign(CubeName, ViewName, DimName, SubName);

If you want to hard code specific elements in a dimension then as below:

DimName = 'base_month_dates'';
SubName = ViewName | '_' |  DimName;
SubsetCreate (DimName, SubName );
(assuming the view and subset are destroyed each time the process is run)
SubsetElementInsert(DimName, SubName, 'Jan', 1);
SubsetElementInsert(DimName, SubName, 'Feb', 1);
SubsetElementInsert(DimName, SubName, 'Mar', 1);
ViewSubsetAssign(CubeName, ViewName, DimName, SubName);
回复 支持 反对

使用道具 举报

70

主题

357

帖子

523

积分

高级会员

Rank: 4

积分
523
QQ
发表于 2014-5-11 05:20:39 | 显示全部楼层
appleglaze28 wrote:How do I create a view to limited to specific elements only? I'm creating this as part of a TI that loads that data 3 times a day daily....I need to zero out the certain elements in certain dimensions specifically date, year and measures for that date so I can refresh the data as scheduled. I have other dates for historical purporses so I don't want to miss out on that and so far I ended up creating a view that zero out all my previous data.

Code: ViewCreate('PRODUCTION_capacity','Current');

ViewTitleDimensionSet('PRODUCTION_capacity','Current','base_month_dates');
ViewTitleDimensionSet('PRODUCTION_capacity','Current','measures_machines_capacity');
ViewTitleDimensionSet('PRODUCTION_capacity','Current','base_years');

ViewTitleElementSet('PRODUCTION_capacity','Current','base_month_dates',DIMIX('base_month_dates',vDate));
ViewTitleElementSet('PRODUCTION_capacity','Current','base_years',DIMIX('base_years',vYear));
ViewTitleElementSet('PRODUCTION_capacity','Current','measures_machines_capacity',DIMIX('measures_machines_capacity','WIP DH Lots'));

ViewZeroOut('PRODUCTION_capacity','Current');

ViewDestroy('PRODUCTION_capacity','Current');


I should probably reiterate what Lotsa said the last time he replied to you, but what the hey, I'm in need of diversion for a moment...

ViewTitleElementSet is not something that should be used with data movement views. There are no titles, rows and columns in data movement views, those relate to how a human arranges a view for the purposes of slicing and dicing. For data movements, you should look at views as flat files.

To create a view to zero out a range of data you use:
- SubsetCreate to create a subset for any dimensions where you want to limit the elements being zeroed.
- SubsetElementInsert to add those elements to the subset;
- ViewCreate to create the view;
- ViewSubsetAssign to attach the subsets created earlier to the view. All other dimensions will use "All" elements;
- ViewExtractSkipZeroesSet and ViewExtractSkipCalcsSet to skip over zeroes and consolidations.
- ViewZeroOut to zero out the data;
- ViewDestroy to destroy the view after you're finished with it;
- SubsetDestroy to destroy the subsets.

本帖子中包含更多资源

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

x
回复 支持 反对

使用道具 举报

87

主题

373

帖子

564

积分

高级会员

Rank: 4

积分
564
QQ
发表于 2014-5-11 05:39:09 | 显示全部楼层
Okay thanks...I guess ive been so concentrated into reading the cube view and never bothered reading the other stuff...Thanks.
回复 支持 反对

使用道具 举报

78

主题

403

帖子

578

积分

高级会员

Rank: 4

积分
578
QQ
发表于 2014-5-11 06:02:08 | 显示全部楼层
Alan Kirk wrote:To create a view to zero out a range of data you use:
- SubsetCreate to create a subset for any dimensions where you want to limit the elements being zeroed.
- SubsetElementInsert to add those elements to the subset;
- ViewCreate to create the view;
- ViewSubsetAssign to attach the subsets created earlier to the view. All other dimensions will use "All" elements;
- ViewExtractSkipZeroesSet and ViewExtractSkipCalcsSet to skip over zeroes and consolidations.
- ViewZeroOut to zero out the data;
- ViewDestroy to destroy the view after you're finished with it;
- SubsetDestroy to destroy the subsets.

Alan,

Is there command to set skip rule values as well?? I've worked around this in the past,

Jim.
回复 支持 反对

使用道具 举报

89

主题

395

帖子

598

积分

高级会员

Rank: 4

积分
598
QQ
发表于 2014-5-11 06:21:45 | 显示全部楼层
jim wood wrote:[quote]Alan Kirk wrote:To create a view to zero out a range of data you use:
- SubsetCreate to create a subset for any dimensions where you want to limit the elements being zeroed.
- SubsetElementInsert to add those elements to the subset;
- ViewCreate to create the view;
- ViewSubsetAssign to attach the subsets created earlier to the view. All other dimensions will use "All" elements;
- ViewExtractSkipZeroesSet and ViewExtractSkipCalcsSet to skip over zeroes and consolidations.
- ViewZeroOut to zero out the data;
- ViewDestroy to destroy the view after you're finished with it;
- SubsetDestroy to destroy the subsets.

Alan,

Is there command to set skip rule values as well?? I've worked around this in the past,

Jim.
[/quote]

You're thinking of ViewExtractSkipRuleValuesSet, I believe.
回复 支持 反对

使用道具 举报

85

主题

408

帖子

596

积分

高级会员

Rank: 4

积分
596
QQ
发表于 2014-5-11 08:03:19 | 显示全部楼层
Cheers Alan,

That isn't in the help file of the version I have been using for a while. Me being me I just specified a desired subset to work around it,

Jim.
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2023-5-31 05:22 , Processed in 0.096208 second(s), 40 queries .

Powered by Discuz! X3.1 Licensed

© 2001-2013 Comsenz Inc.

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