cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Fox to loop through many fiscal years

former_member246680
Participant
0 Kudos
287

Hi all,

I have written fox to loop previous fiscal years and calculate data for the following year. My issues is my formula is looping through only the fiscal year that I select (im using a mandatory single fiscal year variable to select the current year)

The formula is as follows:

ZYEAR = VARV( ZBPC_FSCYEAR_S_M ).

FOREACH ZPP, ZACC.

DO.

ZPP = TMVL( ZPP, 1, ZVAR ).

ZPREYEAR = TMVL( ZYEAR, - 1, ZVAR ).

ZPER = CONCAT( ZPREYEAR, ZPP ).

ZYPER = CONCAT( ZPREYEAR, 000 ).

AMT1 = { ZAMOUNT, ZPER, ZPP, V6, ZPREYEAR, ZBPC_BUD, ZSD, ZACC }.

IF ZPP = 012. EXIT. ENDIF. ENDDO.

For example if i select year 2019, i want the system to loop through 2018 values and calculate based on those values. But the problem is when i select 2019, the system is only looping through 2019 values and not 2018.

Kindly assist

Regards

Jordan

Accepted Solutions (1)

Accepted Solutions (1)

former_member246680
Participant
0 Kudos

Hi,

I have the answer. Just had to offset the fiscal year variable and add in the filter.

Regards

Jordan

Answers (0)