Page 1 of 1

Conditional Feeder Help

Posted: Mon Jun 15, 2015 7:10 pm
by PlanningDev
We have a cube where data is pulled from another cube based on an attribute.

Something along the lines of

Code: Select all

['Expense'] = N: DB('Cube 2', 'Element 1', ATTRS( 'Dimension2, !Dimension2, 'Source Element Name'), 'Element 3');
It would seem that in this case we would need to write a conditional feeder in order to correctly feed the cube from the source.

Code: Select all

['Expense'] => DB( if(ATTRS( 'Dimension2, !Dimension2, 'Source Element Name')@=!SourceDim, 'Cube 1', ''), !Dim1, !Dim2, !Dim3);
No matter what we do we get an invalid string expression when trying to save the rule after adding the feeder. The only thing different about the cubes is the single dimension that we lookup the element name from the attribute.

Does this make sense? Im sure others have written rules that were dynamic to attributes? How do you feed this? Our thoughts at this point are to create a rollup in the target dimension that contains all the elements that lookup their value based on the attribute and just overfeed that subtotal.

Does the logical expression have to contain only elements from source cube? Our issue is that we have to lookup the source element from the attribute of the target dimension.

Any help?

Re: Conditional Feeder Help

Posted: Mon Jun 15, 2015 7:47 pm
by tomok
How can we help you if you insist in showing useless pseudocode? It could be as simple as a syntax error but there's no way we would know that from the information you've provided.

In what cube do you have the feeder? Is it cube 2? If so, are all the dimensions you have with ! in front of them exist in that cube? Once again, so hard to help without the actual facts.

Re: Conditional Feeder Help

Posted: Mon Jun 15, 2015 8:12 pm
by PlanningDev
Sorry for the pseudo code, In my attempts to simplify it down it has in turn become more confusing.

Here is the actual rule. This rule is part of the Consolidated Cube and it is reading data from the Capital Planning Cube. All dimensions match or are able to have a hard coded value except for the Consolidated Line and Capital Project dimension.

Code: Select all

#Region Capital Planning
['TM1 Cube','US']   = N:  if(ATTRS('ConsolidatedLine',!ConsolidatedLine,'CapitalPlanningLineName')@<>'',
DB('Capital Planning',ATTRS('ConsolidatedLine', !ConsolidatedLine, 'CapitalPlanningLineName'),'GAAP',!Month,!Version,!Year,'Expense')
, CONTINUE);
What we are trying to do is write the feeder for this rule.

Something like this

Code: Select all

['Expense'] => DB(IF(ATTRS('ConsolidatedLine', !ConsolidatedLine, 'CapitalPlanningLineName')@=!Capital Projects, 'ConsolidatedFinStmts', ''),'TM1 Cube','Forecast',!Month,!Year,'US',!ConsolidatedLine,'Amount');

Re: Conditional Feeder Help

Posted: Mon Jun 15, 2015 8:19 pm
by tomok
Incomplete facts. What are the names of the dimensions in each cube and in what order do they appear. Have you ever read the request for assistance guidelines???

Re: Conditional Feeder Help

Posted: Tue Jun 16, 2015 9:21 pm
by Mems

Code: Select all

['Expense'] => 
DB(IF(ATTRS('ConsolidatedLine', !ConsolidatedLine, 'CapitalPlanningLineName')@=!Capital Projects, 'ConsolidatedFinStmts', ''),
'TM1 Cube',
'Forecast',!Month,!Year,'US',!ConsolidatedLine,'Amount');


!Capital Projects - is that a dimension in the cube?
Is 'TM1 Cube' an element or a cube? I am assuming it's an element or that should not be there, but I agree with tomok, post the real code and list of cubes/dimensions.
It's impossible to assist otherwise