Focal Point
[SOLVED] Best Practice for currencies calculations???

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7917063216

November 07, 2011, 08:24 AM
ChristianP
[SOLVED] Best Practice for currencies calculations???
Hello,

i have a table with sales figures for the last four business years. In this table i have three currencies
EUR, USD and BPD. I also have a table with the average exchange rates of the fiscal years. What is the
best way to calculate the currencies to EURO. Is it an option to calculate them direct on the master file
of the sales figures table with a huge if then else story.

Regards

Christian

This message has been edited. Last edited by: ChristianP,


WF Production Version: 7.7.02M
WF Test Version: 7.7.02M
Developer Studio: 7.7.02
HTML, EXL2K, FLEX, PDF,PPT
November 07, 2011, 09:58 AM
Håkan
Christian

I would refrain from coding this in the Master file. Rather have a separate table which can generate a textfile with the currency and, year and rate, e.g.

EUR2008 9.00
USD2009 6.85
GBP2010 10.50

APP PREPENDPATH test
APP FI xrates DISK test/xrates.txt
DEFINE FILE CAR
currency_year/A7 = DECODE COUNTRY( 'ENGLAND' 'EUR2008' 'FRANCE' 'USD2009' ELSE 'GBP2010' );
END
TABLE FILE CAR
SUM
DEALER_COST
COMPUTE eur_value = DECODE currency_year(xrates);
COMPUTE eur_dealer_cost = DEALER_COST * eur_value;
BY
COUNTRY
END

Håkan


WebFOCUS DS 8.0.06/08 DS/AS
WebFOCUS RS 8.0.08 (Linux/IBM i)
WebFOCUS Client 8.0.06 (Linux)
November 07, 2011, 10:30 AM
ChristianP
Hi Håkan,

thanks a lot!! Where do i have to place the xrates.txt file??
Regards

christian


WF Production Version: 7.7.02M
WF Test Version: 7.7.02M
Developer Studio: 7.7.02
HTML, EXL2K, FLEX, PDF,PPT
November 07, 2011, 10:35 AM
ChristianP
Hi Håkan,

i got it !!!! Perfect!!!!

Christian


WF Production Version: 7.7.02M
WF Test Version: 7.7.02M
Developer Studio: 7.7.02
HTML, EXL2K, FLEX, PDF,PPT
November 07, 2011, 10:37 AM
Håkan
Christian

you can put it anywhere, just issue the APP FI command to the app (in the APP PATH) where your file is located.

Håkan


WebFOCUS DS 8.0.06/08 DS/AS
WebFOCUS RS 8.0.08 (Linux/IBM i)
WebFOCUS Client 8.0.06 (Linux)