Firstly, you'll need to make sure you don't have duplicate rates in your rates sheet - you have 2 USD rates in the example provided.
Secondly, what's the error you're getting? Is it something like "All fields must be aggregate or constant…".
If so, you need to apply an aggregation to the rate's table. The following should work:
Thanks for prompt response
I don't have duplicates in my rate table - there's an error in above exampl. I think, however, that Your suggestion pointed me to the solution. Now I have calculation build like that:
First part is for calculating the transaction value. I was missing sum() in the first part and thus I was receiving 'Cannot mix aggregate and non-aggregate error'.
Glad to hear that it worked out for you.
Also, I assume your shipping cost is per order / invoice and not per quantity being shipped. Otherwise your math is wrong.