You can keep local and converted values in a database. In the main database, you must define the members that store the local and converted values by creating a currency partition dimension (see Main Database). The currency partition dimension has one partition for local values and one for converted values.
To create a calculation script that copies local data to a converted partition and calculates the data:
The following example is based on the Sample.Interntl database and the corresponding Sample.Xchgrate currency database. Figure 47, Calculating Local and Converted Currency Conversions shows the currency partition from the Sample.Interntl database.
The following calculation script performs three currency conversions for Actual, Budget, and Actual @ Bud Xchg data values:
/* Copy data from the local partition to the master partition (for converted values) */ DATACOPY Act TO Actual; DATACOPY Bud TO Budget; /* Convert the Actual data values using the "Act xchg" rate */ FIX(Actual) CCONV "Act xchg"->US$; ENDFIX * Convert the Budget data values using the "Bud xchg" rate */ FIX(Budget) CCONV "Bud xchg"->US$; ENDFIX /* Convert the "Actual @ Bud XChg" data values using the "Bud xchg" rate */ FIX("Actual @ Bud XChg") CCONV "Bud xchg"->US$; ENDFIX /* Recalculate the database */ CALC ALL; CALC TWOPASS;
The following calculation script converts the Actual and Budget values back to their original local currency values:
FIX(Actual) CCONV TOLOCALRATE "Act xchg"; ENDFIX FIX(Budget) CCONV TOLOCALRATE "Bud xchg"; ENDFIX CALC ALL;