Sie sind auf Seite 1von 5

  KNOWLEDGE BASE  adistrategies.

com 
 

Knowledge Base Item #: [ID:0042] 

Definition: Calculation script example for currency conversion 

Solution:  

SET CLEARUPDATESTATUS OFF; 

SET UPDATECALC OFF; 

SET CALCPARALLEL 3; 

SET AGGMISSG ON; 

SET CACHE HIGH; 

FIX ("Actual", "at Budget Rate", &Curr_Year, @REMOVE(@RELATIVE("Account",0), @RELATIVE("Period 
Ending Rates",0))) 

  CLEARDATA "USD"; 

  CLEARDATA "EUR"; 

  CLEARDATA "GBP"; 

  CLEARDATA "SGD"; 

  CLEARDATA "Local"; 

ENDFIX 

FIX (&Curr_Year, "Local", @RELATIVE("1USPL",0)) 

  DATACOPY "Actual"‐>"Final" TO "Actual"‐>"at Budget Rate"; 

ENDFIX 

SET CREATEBLOCKONEQ ON; 

FIX (&Curr_Year, "Actual", "at Budget Rate", "No Product", "No Project", "No Entity", "Jan":"Dec") 

All the information on this website is published in good faith and for general information purpose only. We do not 
make any warranties about the completeness, reliability and accuracy of this information. Any action you take 
upon the information on our website is strictly at your own risk and we will not be liable for any losses and 
damages in connection with the use of our website. 
  KNOWLEDGE BASE  adistrategies.com 
 

"USD" 

  "USD"‐>"USD Per LC" = @XREF("AAA", "Budget", "Final", "USD", "USD Per LC"); 

  "SGD"‐>"USD Per LC" = @XREF("AAA", "Budget", "Final", "SGD", "USD Per LC"); 

  "HKD"‐>"USD Per LC" = @XREF("AAA", "Budget", "Final", "HKD", "USD Per LC"); 

  "AUD"‐>"USD Per LC" = @XREF("AAA", "Budget", "Final", "AUD", "USD Per LC"); 

  "JPY"‐>"USD Per LC" = @XREF("AAA", "Budget", "Final", "JPY", "USD Per LC"); 

  "EUR"‐>"USD Per LC" = @XREF("AAA", "Budget", "Final", "EUR", "USD Per LC"); 

  "GBP"‐>"USD Per LC" = @XREF("AAA", "Budget", "Final", "GBP", "USD Per LC"); 

  "CHF"‐>"USD Per LC" = @XREF("AAA", "Budget", "Final", "CHF", "USD Per LC"); 

); 

ENDFIX 

SET CREATEBLOCKONEQ OFF; 

/* 

  Convert all Local currency input into USD  

*/ 

FIX ("Actual", "at Budget Rate", &Curr_Year, @RELATIVE("Entity",0), @RELATIVE("Product",0),"No 
Project") 

DATACOPY "Local" TO "USD"; 

"USD" 

IF (@ISDESC("Entity")) 

@CALCMODE(BOTTOMUP); 

@CALCMODE(BLOCK); 

All the information on this website is published in good faith and for general information purpose only. We do not 
make any warranties about the completeness, reliability and accuracy of this information. Any action you take 
upon the information on our website is strictly at your own risk and we will not be liable for any losses and 
damages in connection with the use of our website. 
  KNOWLEDGE BASE  adistrategies.com 
 

  IF(@ISMBR(@WITHATTR("Input Currency","==","SGD Source"))) 

      "USD" = "USD" * "USD Per LC"‐>"SGD"‐>"No Entity"‐>"No Product"‐>"No 
Project"; 

  ELSEIF(@ISMBR(@WITHATTR("Input Currency","==","HKD Source"))) 

      "USD" = "USD" * "USD Per LC"‐>"HKD"‐>"No Entity"‐>"No Product"‐>"No 
Project"; 

  ELSEIF(@ISMBR(@WITHATTR("Input Currency","==","AUD Source"))) 

      "USD" = "USD" * "USD Per LC"‐>"AUD"‐>"No Entity"‐>"No Product"‐>"No 
Project"; 

  ELSEIF(@ISMBR(@WITHATTR("Input Currency","==","JPY Source"))) 

      "USD" = "USD" * "USD Per LC"‐>"JPY"‐>"No Entity"‐>"No Product"‐>"No 
Project"; 

  ELSEIF(@ISMBR(@WITHATTR("Input Currency","==","EUR Source"))) 

      "USD" = "USD" * "USD Per LC"‐>"EUR"‐>"No Entity"‐>"No Product"‐>"No 
Project"; 

  ELSEIF(@ISMBR(@WITHATTR("Input Currency","==","GBP Source"))) 

      "USD" = "USD" * "USD Per LC"‐>"GBP"‐>"No Entity"‐>"No Product"‐>"No 
Project"; 

  ELSEIF(@ISMBR(@WITHATTR("Input Currency","==","CHF Source"))) 

      "USD" = "USD" * "USD Per LC"‐>"CHF"‐>"No Entity"‐>"No Product"‐>"No 
Project"; 

  ENDIF 

ELSEIF (@ISUDA("Account","Asset") OR @ISUDA("Account","Liability") OR @ISUDA("Account","Other")) 

  "USD" = #Missing; /* only have PnL rates available at the moment. */ 

ENDIF 

ENDFIX 

All the information on this website is published in good faith and for general information purpose only. We do not 
make any warranties about the completeness, reliability and accuracy of this information. Any action you take 
upon the information on our website is strictly at your own risk and we will not be liable for any losses and 
damages in connection with the use of our website. 
  KNOWLEDGE BASE  adistrategies.com 
 

/* 

  Convert USD to EUR and GBP for EU reporting 

*/ 

FIX ("Actual", "at Budget Rate", &Curr_Year, @RELATIVE("EU Entity",0), @RELATIVE("Product",0),"No 
Project") 

  DATACOPY "USD" TO "EUR"; 

  DATACOPY "USD" TO "GBP"; 

  "EUR" 

  ( 

    IF (@ISDESC("US PL Entity")) 

      @CALCMODE(BOTTOMUP); 

      @CALCMODE(BLOCK); 

      "EUR" = "EUR" * (1 / "USD Per LC"‐>"EUR"‐>"No Entity"‐>"No Product"‐>"No 
Project"); 

      "GBP" = "GBP" * (1 / "USD Per LC"‐>"GBP"‐>"No Entity"‐>"No Product"‐>"No 
Project"); 

    ENDIF 

  ) 

ENDFIX 

/* 

  Convert USD to SGD  

*/ 

FIX ("Actual", "at Budget Rate", &Curr_Year, @RELATIVE("Asia Entity",0), @RELATIVE("Product",0),"No 
Project") 

  DATACOPY "USD" TO "SGD"; 

All the information on this website is published in good faith and for general information purpose only. We do not 
make any warranties about the completeness, reliability and accuracy of this information. Any action you take 
upon the information on our website is strictly at your own risk and we will not be liable for any losses and 
damages in connection with the use of our website. 
  KNOWLEDGE BASE  adistrategies.com 
 

  "SGD" 

  ( 

    IF (@ISDESC(“US PL Entity")) 

      @CALCMODE(BOTTOMUP); 

      @CALCMODE(BLOCK); 

      "SGD" = "SGD" * (1 / "USD Per LC"‐>"SGD"‐>"No Entity"‐>"No Product"‐>"No 
Project"); 

    ENDIF 

  ) 

ENDFIX 

All the information on this website is published in good faith and for general information purpose only. We do not 
make any warranties about the completeness, reliability and accuracy of this information. Any action you take 
upon the information on our website is strictly at your own risk and we will not be liable for any losses and 
damages in connection with the use of our website. 

Das könnte Ihnen auch gefallen