I am having some trouble with my currency translation calculation. To explain this, let's say I have 2 additional exchange rates (AVGRATE1 and AVGRATE2) that I want to use for my cash flow accounts besides the default EOM and AVG rates that are stored in my HFM application. I understand that HFM's translation rule is cumulative in nature and here's what I have in my translation subroutine.
As you can tell, I want all the accounts to be translated using the AVGRATE1 except for CF_XXX accounts. What I am seeing is that it is doing the translation twice and I end up getting twice the amount in the <PARENT CUURENCY> of A#CF_XXX.
I know I can add some IF ELSE statements to handle this but I is there a cleaner way to do this? I have done some research and looked around but can;t find a cleaner solution.
Assuming that C2#CFCALC member has been defined as SwitchTypeForFlow = "N", and CF accounts are of revenue or expense type, then the C2#CFCALC member behaves as revenue/expense and is translated using the normal average rate as defined in the applicationsettings record. When the Sub Translate() routine starts to execute your first line correctly translates CFCALC using AVGRATE1. The second line finds CFCALC translated by the first rate and needs to carry the translated amount to the translated value corresponding to the second rate. Then your second line should look like:
Though I have some doubts about your code, I would write it like this (keeping the same concepts I have mentioned above), in order to preserve the sequence HFM uses for retrieving rates from various locations (same entity, entity [None], triangulation etc):
Hi Kostas, thank you for your help. I just tested it and it works! I have never quite understand the second exchange rate parameter in the HS.TRANS function. My understanding (probably not correct) of that second parameter was only needed when you need to calculate the net difference of the result between after applying the rates.
As you mentioned this thing works cumulatively on the destination, meaning that when your first line executes it translates using AVG1, then when the second line executes it takes the difference (AVG2 - AVG1) as a rate and accumulates the translated value on the destination. Intrinsically the two rate arguments of HS.Trans work like the difference of the two rates. For example, when you want to calculate exchange differences you use the fxdiff pov as the destination like this: