Page 1 of 1

TI Process to spread data at consolidation Level

Posted: Tue Jul 08, 2014 4:01 pm
by dharav
Hello All

We have two cubes. A and B. Cube A is the input cube at leaf level. Now, we have to give Action Button to user to run TI to spread the data from respective consolidation element in Cube B.

Suppose, I have Source View in Cube A called 'Thriller

#########PROLOG################

PHierarchy='NNJ00101 - New Jersey Metro';
Vsrccube='A';
Vtgtcube='B';
Vsrcview='Thriller';
Vtgt='Expandable';


If(viewexists(Vtgtcube,vtgt)=1);
viewdestroy(vtgtcube,vtgt);
Endif;

Viewcreate(Vtgtcube,Vtgt);


Subsetcreate ('Hierarchy', 'Transformer2');
SubsetElementInsert ('Hierarchy', 'Transformer2','NJ Metro', 1);




Viewsubsetassign (Vsrccube,Vsrcview,'Metro Hierarchy', 'Transformer'); ####Transformer has leaf level element 'NJ Metro'
Viewsubsetassign (Vsrccube,Vsrcview,'forecastcalculations','Manual Forecast');
Viewsubsetassign (Vsrccube,Vsrcview,'accounts','All Members');
Viewsubsetassign (Vsrccube,Vsrcview,'Months','Months');
################################################################
Viewsubsetassign(Vtgtcube,Vtgt,'Hierarchy', 'Transformer2'); ######Transformer 2 has consolidated element 'NJ Metro'
Viewsubsetassign(Vtgtcube,Vtgt,'forecastcalculations','Manual Forecast');
Viewsubsetassign(Vtgtcube,Vtgt,'accounts','All Members');
Viewsubsetassign(Vtgtcube,Vtgt,'Months','Months');

#### Zero Out the view ####

Viewzeroout(Vtgtcube,Vtgt);

Data:

IF(CELLISUPDATEABLE (Vtgtcube,'NJ Metro', V2,V3,V4)=1);
CellPutProportionalSpread(NValue,Vtgtcube,'NJ Metro',V2, V3,V4);
ENDIF;

Epilog:

Viewdestroy ();
Subsetdestroy ();


I wrote above process but couldn't able to get success. Process goes successfully but data is not there. I put 1 for n level element to spread back but it also not work.

For Process:
Could you direct me where i am going in different direction? Do we need to put 1 through loop to each child to perform proportional data spread (IF WE MAKE CHANGES (T) IN CFG FILE FOR PROPORTIONAL SPREAD, WOULD THAT HELP?)

Let me know if further information required.

Thanks

Re: TI Process to spread data at consolidation Level

Posted: Tue Jul 08, 2014 4:41 pm
by tomok
What is in the Expandable cube BEFORE you run the process? Is it empty? If so, the CellPutProportionalSpread will not do anything. That function can only spread when there is already something in the node you are spreading to because it needs that to do the proportional calculations.

Re: TI Process to spread data at consolidation Level

Posted: Tue Jul 08, 2014 4:52 pm
by declanr
Take away the cell is updateable if statement. Assuming that is against the consolidation.

And as per Tomok's comment; if you want it to do an even spread against all children if there isn't already a number you can use ElcompN (or a mdx zero subset of that elements descendants if it has levels of separation) and loop through the nodal elements.

Re: TI Process to spread data at consolidation Level

Posted: Tue Jul 08, 2014 5:36 pm
by sachin
dharav wrote: ....
Viewsubsetassign(Vtgtcube,Vtgt,'Hierarchy', 'Transformer2'); ######Transformer 2 has consolidated element 'NJ Metro'
....
Data:

IF(CELLISUPDATEABLE (Vtgtcube,'NJ Metro', V2,V3,V4)=1);
CellPutProportionalSpread(NValue,Vtgtcube,'NJ Metro',V2, V3,V4);
ENDIF;
You mentioned that "NJ Metro" is Consolidated element in Hierarchy dimension in your target cube. My understanding is that in the data tab, CellIsUpdateable is returning you 0 (Since NJ Metro will be a C type) and hence the proportional spread is not happening.