Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am developing an application it has field name called as cost currency it has currencies of USD,MXN,CAD
All these should be converted to USD only
Help me to solve this
Thanks
Hello,
I assume that you have something like this:
LOAD
"Cost" as "Cost Original",
"Cost Currency" as "Cost Currency"
FROM [...]
(...);
In that use case scenario you can use:
LOAD
Num("Cost"/PICK(Match([Cost Currency], 'USD', 'MXN', 'CAD'), 1, 20.68140, 1.30320), '#,##0.00;-#,##0.00') as "Cost",
'USD' as "Cost Currency"
FROM [...]
(...);
As you can see it has converted all the Cost Currency to appear as USD and then converted the values as per the exchange rate supplied. Match() function will return 1, 2 or 3 value based on the currency and the Pick() function will return 1, 20.68, 1.30 etc. Therefore if Match() returns 1 the Pick() function will return 1. So Cost/1 = Cost which means that the value will not change for all USD currency values. However, if e.g. Match() returns 2, then Pick() will return 20.68, therefore Cost/20.68 will give you the cost value of MXN in USD.
NOTE: Keep in mind that you will have to manually supply the real exchange rate whenever you are going to reload the application and if you have more than 2 currencies that needs to be converted to USD, you will have to find a different approach supplying them. Maybe this article [1] will help you achieve you with further details.
I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, addressed your concerns or at least pointed you in the right direction, please mark it as Accepted Solution to give further visibility to other community members.
---
Hello,
Unfortunately your use case scenario is a bit too complicated so it might not be fully supported by Qlik Sense. You can try the following steps:
Additionally:
I hope that this information is helpful