C level rule to calculate average
Posted: Thu Oct 11, 2012 8:08 am
Hi all,
I have the following rule to caluclate the average cost per day:
The results are correct as per the rule so it works. However the days per month needs to be dynamic rather than a hard coded "31". The Time_Day dimension has the days at n level and months at c level. The dimension has an attribute called "Days per month". At the C/Month level of the dimension this attribute is populated with the days of the month.
When I replace the "31" with either of the below 2 pieces of code that try to bring back the "Days per month" just brings back "0":
or
Is this because an attribute against a C level element cannot be referenced?
Thanks for any advice.
I have the following rule to caluclate the average cost per day:
Code: Select all
['Product a','Average Final Value'] = C:
IF(
ATTRS('Time_Day',!Time_Day,'Act For')@='Actual',
DB('Production Actuals',!Production Hierarchy,'Oil','mmscfd',!Time_Day,'Final Value')\31,
CONTINUE
)
;
When I replace the "31" with either of the below 2 pieces of code that try to bring back the "Days per month" just brings back "0":
Code: Select all
ATTRN('Time_Day',!Time_Day,'Days per month'),
Code: Select all
DB('}ElementAttributes_Time_Day',!Time_Day,'Days per month'),
Thanks for any advice.