cancel
Showing results for 
Search instead for 
Did you mean: 

Copy different Key Figure value in different month

Former Member
0 Kudos

Hi experts,

i would like to know if it's (and how it's) possible to modify a Key Figure value with a FOX Formula in this manner:

Key Figure K2 for month N must be equal to Key Figure K1 for month N-1. There is not a variable on 0CALMONTH and on 0CALMONTH2 characteristic in the selected level (exist only a variable on 0CALYEAR). In other words i want that Key Figure K2 for month N must be equal to Key Figure K1 for the previous month. N goes from 02 to 12

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Fabio,

Say if you want to copy Key figure K1 from 0calmonth 001.2005 to all 0calmonth values from 002.2005 to 12.2005.

As I understand you are trying to achieve.

Then create a Copy function with

Fields to be changed 0calmonth and

Fields for condition whatever Company/profit center for

which you want to copy the key figure

Create the Paramter group with

Condition for the relevant company/profit center

Detail From 0calmonth To 0calmonth

001.2005 002.2005

001.2005 003.2005

and so on till

001.2005 012.2005

One you execute the Parameter group this would copy the key figure value K1 in 0calmonth 001.2005 to all the succeeding months 002.2005 to 012.2005.

Hope it helps.

Cheers

Anurag

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks for the answer!

I have not variable on 0calmonth and 0calmonth2 so i cannot derive value for these characteristics in FOX fornula.

Fabio

Former Member
0 Kudos

Fabio,

You need to copy from calmonth to calmonth -1 right?

what are these 2 0calmonth & 0calmonth2? are these 2 point to same characteristic or different characteristic?

if they point to same characteristic, you should be able to derive calmonth-1 from calmonth in FOX.

were you able to use tmvl function to do this?

if they point to different characteristics, let us know more details on this.

Former Member
0 Kudos

Fabio,

I just tested this & it works as per your requirement.

if you can't use a variable & if you want to copy for each & everymonth calmonth value, use the following code.

fields to be changed are KEY FIGURE NAME & CALMONTH.

DATA CM type 0calmonth 'current calmonth

DATA LCM type 0calmonth 'current calmonth - 1

FOREACH CM.

LCM = TMVL(CM, -1).

(K2, LCM) = (K1, CM).

ENDFOR.

hope it helps.

Former Member
0 Kudos

1000 Thanks hari,

so it's possible to use a local variable (defined in the FOX formula) in TMVL statement.

I'll soon try the code.

Fabio

Former Member
0 Kudos

I Anurag,

i know that standard copy FOX formula does not support the change of key figure...could you let me know how to do my requirement with standard function?

Many thanks.

Fabio

Former Member
0 Kudos

Fabio,

You should be able to do this easily in FOX.

copy from "key figure K1 for month N" to "key figure K2 for month N-1".

but, i've couple of questions for you.

do u have any variables for CALMONTH?

Do you have any other characteristics that needs to be changed as well?

if you don't have variables for CALMONTH,

just use, foreach calmonth loop to loop through each value.

use tmvl to derive previous month.

& finally copy K1 into K2 with K2 = k1.

let me know if you need detailed coding.

hope it helps.

Former Member
0 Kudos

Hi Fabio,

Any particular reason why you would like to achieve this functionality using FOX as you could achieve the same using the standard Copy Planning Function.

Hope it helps.

Cheers

Anurag