I recently developed a rule that use an IF statement. But the values are not adding up into the consolidation.
The rule check if for every day (Reporting Period Daily dimension), the value is 0 or <>0 in the dimension (FA Measures dimension) for an element called "Entry Price". If the value is 0, it will use the DB function to reflect the value of the previous day in the element called "1_Entry Price" , if the previous day is 0 as well, it will use the value of the second previous day, and if the second previous day is 0 again, it will use the value of the third previous day. If the value is <>0, it will just use the value of the day:
This is the cube: This is my code
Code: Select all
['1_Entry Price']= IF(
DB('Fund Accounting Daily',!Portfolio Code,DIMNM('Reporting Period Daily',DIMIX('Reporting Period Daily', !Reporting Period Daily)),'Entry Price')=0 &
DB('Fund Accounting Daily',!Portfolio Code,DIMNM('Reporting Period Daily',DIMIX('Reporting Period Daily', !Reporting Period Daily)-1),'Entry Price')=0 &
DB('Fund Accounting Daily',!Portfolio Code,DIMNM('Reporting Period Daily',DIMIX('Reporting Period Daily', !Reporting Period Daily)-2),'Entry Price')=0
,DB('Fund Accounting Daily',!Portfolio Code,DIMNM('Reporting Period Daily',DIMIX('Reporting Period Daily', !Reporting Period Daily)-3),'Entry Price'),
IF(
DB('Fund Accounting Daily',!Portfolio Code,DIMNM('Reporting Period Daily',DIMIX('Reporting Period Daily', !Reporting Period Daily)),'Entry Price')=0 &
DB('Fund Accounting Daily',!Portfolio Code,DIMNM('Reporting Period Daily',DIMIX('Reporting Period Daily', !Reporting Period Daily)-1),'Entry Price')=0
,DB('Fund Accounting Daily',!Portfolio Code,DIMNM('Reporting Period Daily',DIMIX('Reporting Period Daily', !Reporting Period Daily)-2),'Entry Price'),
IF(
DB('Fund Accounting Daily',!Portfolio Code,DIMNM('Reporting Period Daily',DIMIX('Reporting Period Daily', !Reporting Period Daily)),'Entry Price')=0
,
DB('Fund Accounting Daily',!Portfolio Code,DIMNM('Reporting Period Daily',DIMIX('Reporting Period Daily', !Reporting Period Daily)-1),'Entry Price')
,DB('Fund Accounting Daily',!Portfolio Code,DIMNM('Reporting Period Daily',DIMIX('Reporting Period Daily', !Reporting Period Daily)),'Entry Price'))));
Feeders;
['Entry Price']=>['1_Entry Price'];
I'm not quite sure what's the feed that I need to develop to make this add up to the consolidation (clearly mine is incorrect).
I'd really appreciate if you guys could help me out.
Thank you very much