Former Member
Sep 26, 2005 at 02:14 PM

# FOX formula problem

40 Views

Hi,

I am trying to do a distribution using the FOX formula below but find that the upper FISCPER value in the FISCPER foreach loops are not being restricted to the FISCPER values that are found in the Project of that particular iteration. Rather they are going to the highest Fiscal Period value to be found in that dataset.

Apart from this problem the distribution gives me what I want. Question is can FOX give me what I want (how?) or do I need to use a User Exit function?

Any ideas/solutions to this.

regards,

Alex

==============

DATA FISCPER TYPE 0FISCPER.

DATA CURRPER TYPE 0FISCPER.

DATA PROJECT TYPE ZPROJECT.

DATA SUMLPLAN TYPE F.

DATA SUMATD TYPE F.

DATA DTRPFCAST TYPE F.

DATA FCOUNTER TYPE I.

• Periods read from variable ZPERIOD

CURRPER = VARV( 'ZPERIOD' ).

*PROJECT = VARV( 'ZVPROJ' ).

• FCOUNTER = 0.

FOREACH PROJECT.

• FCOUNTER = 0.

MESSAGE I001(PROJECT) WITH PROJECT.

MESSAGE I001(CURRPER) WITH CURRPER.

SUMATD = 0.

SUMLPLAN = 0.

FCOUNTER = 0.

FOREACH FISCPER.

• Sum PLAN

SUMLPLAN = { EUR,S,FISCPER,NW,020,PROJECT } +

SUMLPLAN.

IF FISCPER <= CURRPER.

• Sum ACTUAL TO DATE

SUMATD = { EUR,S,FISCPER,000,010,PROJECT } +

SUMATD.

• Zero out prior latest plans

{ EUR,S,FISCPER,NW,020,PROJECT } = 0.

ENDIF.

• Determine remaining number of periods

IF FISCPER > CURRPER.

FCOUNTER = FCOUNTER + 1.

ENDIF.

ENDFOR.

• Determine new standard Forecast per future period

DTRPFCAST = 0.

DTRPFCAST = (SUMLPLAN - SUMATD)/FCOUNTER.

• Redistribute Forecast

FOREACH FISCPER.

IF FISCPER > CURRPER.

{ EUR,S,FISCPER,NW,020,PROJECT } = FCOUNTER.

ENDIF.

ENDFOR.

ENDFOR.