 Former Member

# BEX calculation of Average Month Unit

Hi,

Could you help me on identifying a solution for our report computation for average of month units? The need is to get the YTD units and divide it by the month of the date parameter. So its Average month units = YTD unit / month

For example:

the date parameter selected is for May 15, 2014 (05/15/2014)

YTD unit is 7,000

The average month unit is calculated as 7000 divide by 5 = 1,400 units.

How could we get the month based on the date selection so that we can use it for the calculation of the average month unit?

Hope you can help.

Thank you.

10|10000 characters needed characters exceeded

### Related questions Former Member
Posted on Sep 25, 2014 at 09:29 AM

Hallo Anne,

Yes, such requirement can achieve via formula variable.

you can write simple code to read input variable date for the query.

get the month out of date and pass it to formula variable.

this formula variable you can use in formula for Average Month unit = YTD units / formula variable(that will pass month value from input variable).

You can create formula variable on date field.

Hope you get hints from this.

Thanks

10|10000 characters needed characters exceeded
• Former Member

thanks all! it works now. i did formula variable with customer exit getting the month from the input date.

• Posted on Sep 24, 2014 at 11:19 AM

Hi

following is a beautiful document and i think this can help you.

YTD Based on Fiscal Year Period without cmod code

thank you

10|10000 characters needed characters exceeded
• Former Member

Hi,

Thanks but We already have the YTD units value. Our problem is to get the month number of the date selection. example is user input date is May 2014. We need to get the value of 5. if user input september the value we need is 9. We need the number value so that we can use it as part of our division formula. What we need to get is the Average month units.

here is the formula for average month unit is equal to YTD units (which we already have) divide by month number based on date selected (which is our problem on how to get it right now, so that we can use it to divide the YTD unit).

Thanks.

• Former Member
Posted on Sep 25, 2014 at 04:13 AM

hi,

Please create formula variable of type replacement path, read the input variable date and calculate month in the formula variable and use this in the calculation.

Average month unit = YTD units * formula variable.

regards,

Arvind.

10|10000 characters needed characters exceeded
• Former Member
Posted on Sep 24, 2014 at 10:58 AM

Hi,

This is a common requirement for calculating YTD.

You can use Customer Exits variables for calculating month based on input date range.

The documents for using exits are available in SCN.

Hope this helps.

regards,

Vikrant

10|10000 characters needed characters exceeded
• Former Member

Hi,

Thanks but We already have the YTD units value. Our problem is to get the month number of the date selection. example is user input date is May 2014. We need to get the value of 5. if user input september the value we need is 9. We need the number value so that we can use it as part of our division formula. What we need to get is the Average month units.

here is the formula for average month unit is equal to YTD units (which we already have) divide by month number based on date selected (which is our problem on how to get it right now, so that we can use it to divide the YTD unit).

Thanks.