Skip to Content
author's profile photo Former Member
Former Member

Adding up 24 months in Fox Formula based on a initial value of period

Hi,

I have the following requirement. I have cost center, cost element and Internal Order in my aggregation created on a multiprovider containing two cubes(ZYPONM and ZYPALLOC).

I need to calculate a rate based on 24 months data and user inputs the first month of the 24 month period. Based on user input I have to pick up the data for the next 24 months based on Internal order. So if I/O starts with 'FVACSICK' it should form part of the numerator and else it would form part of the denominator.

I have written the following code. For the denominator we need to divide by a attribute of cost element known as Payscale. This is not working and the 24 months are not being summed up. Only individual months are getting summed up. Please help me achieve my goal. Thanks.

DATA CC TYPE ZYCOSTCTR.

DATA CE TYPE ZYCOSTELM.

DATA IO TYPE ZYORDER.

DATA PFUND TYPE F.

DATA DBASE TYPE F.

DATA RATE TYPE F.

DATA VAR_PS TYPE F.

DATA VAR_FP TYPE 0FISCPER.

VAR_FP = VARV( ZVCMSM0FISCPER ).

PFUND = 0.

DBASE = 0.

RATE = 0.

FOREACH CC, IO, CE.

DO 24 TIMES.

IF IO CP 'FVACSICK*'.

PFUND = PFUND + { 0AMOUNT, USD, VAR_FP, ZYPONM, ME_INPUT, CC, CE, IO } + { 0AMOUNT, USD, VAR_FP, ZYPONM, ME_INPUT_ADJ, CC, CE, IO }.

ELSE.

VAR_PS = ATRV( ZPSCALE, CE ).

DBASE = DBASE + ( { 0AMOUNT, USD, VAR_FP, ZYPONM, ME_INPUT, CC, CE, IO } / VAR_PS ) + ( { 0AMOUNT, USD, VAR_FP, ZYPONM, ME_INPUT_ADJ, CC, CE, IO } / VAR_PS ).

ENDIF.

VAR_FP = TMVL( VAR_FP, 1 ).

ENDDO.

ENDFOR.

*BREAK-POINT.

IF NOT DBASE IS INITIAL.

RATE = PFUND / DBASE.

ENDIF.

IF CC CP '2100*'.

{ ZVNS_RPER, #, #, ZYPALLOC, AE_V&S, 'SDGE-PRHO', '0006110401', FVACSICK2100 } = RATE.

ELSEIF CC CP '2200*'.

{ ZVNS_RPER, #, #, ZYPALLOC, AE_V&S, 'SOCL-PRHO', '0006110401', FVACSICK2200 } = RATE.

ENDIF.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Dec 11, 2015 at 01:37 AM

    Hi Arnab,

    Have you known the script RSPLFC_DEBUGGING_SCRIPT_FOX used for fox formula ?

    See the following page:

    Debugging a planning function of type formula in BW-IP

    Debugging Fox Formulas in BW-IP and PAK

    I think after you are familiar with it, you can solve most of fox coding during designing time.

    Best Regards,
    Sheldon.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 11, 2015 at 10:54 AM

    Hi Amab,

    at first glance your fox looks good.

    Are you saying, that the summation for PFUND is working but not for DBASE?

    Is your fox really going into the else?

    regards

    Cornelia

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.