Page 1 of 1
How to create view in TI to specific elements
Posted: Mon Sep 20, 2010 1:35 am
by appleglaze28
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: Select all
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');
Re: How to create view in TI to specific elements
Posted: Mon Sep 20, 2010 1:51 am
by jrizk
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);
Re: How to create view in TI to specific elements
Posted: Mon Sep 20, 2010 1:52 am
by Alan Kirk
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: Select all
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.
Re: How to create view in TI to specific elements
Posted: Mon Sep 20, 2010 3:49 am
by appleglaze28
Okay thanks...I guess ive been so concentrated into reading the cube view and never bothered reading the other stuff...Thanks.
Re: How to create view in TI to specific elements
Posted: Tue Feb 08, 2011 4:46 pm
by jim wood
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.
Re: How to create view in TI to specific elements
Posted: Tue Feb 08, 2011 5:35 pm
by Alan Kirk
jim wood wrote: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.
You're thinking of ViewExtractSkipRuleValuesSet, I believe.
Re: How to create view in TI to specific elements
Posted: Wed Feb 09, 2011 9:13 am
by jim wood
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.