cancel
Showing results for 
Search instead for 
Did you mean: 

BEX calculation of Average Month Unit

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Answers (3)

Answers (3)

Former Member
0 Kudos

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.

former_member182997
Contributor
0 Kudos

Hi

following is a beautiful document and i think this can help you.
Please refer below:"

thank you

Former Member
0 Kudos

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
0 Kudos

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

Former Member
0 Kudos

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.