We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

Multi-currency report

Answered
Janez asked on February 13, 2023

We have report where value is in different currencies.
Report example:
Dimensions: Rows(Customer, Region, Salesman), Coulumns (Currency)
Measure: price (which is in different currencies)
Do you have any best practices how do you handle the price metric not to sum up when user remove the dimension from pivot table?

4 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster February 14, 2023

Hello, Janez!

Thank you for reaching out to us.

There are two possible approaches for handling such cases. You can either use the calculated values to create different measures for each currency or restrict the possibility of removing the "Currency" column from the report. 

Using calculated values
Based on the provided slice structure, there is no other way of identifying the currency except by showing the "Currency" column. However, this column can be modified (or a new one can be added) to store a numeric currency code. This is required since calculated values only work with numbers. The formula will use the if statement to add the price to measure only when it matches the specific code:

{
  uniqueName: "Price USD",
  formula: "if( sum(\"CurrencyCode\") = 1 , sum(\"Price\") , 0 )",
  individual: true,
  caption: "Price USD",
 format: "USD"
},
{
  uniqueName: "Price EUR",
  formula: "if( sum(\"CurrencyCode\") = 2 , sum(\"Price\") , 0 )",
  individual: true,
  caption: "Price EUR",
  format: "EUR"
}

This approach would prevent the metrics from summing up since now they are stored as separate measures. We have prepared an example for this case: https://jsfiddle.net/flexmonster/Lzj8wksn/ 

Another benefit of using calculated values to create separate measures for each currency is that it becomes possible to add formatting with currency signs for each measure.

Restricting the report modifications
Instead of creating new measures, it is possible to make the "Currency" column unremovable. The simplest solution would be to enable the read-only mode with the readOnly option. But it is also possible to use other options only to restrict the functionality that can be used to remove some columns from the slice: https://jsfiddle.net/flexmonster/573zy8m4/ 

In case you would like to keep the Field List available for users, you can validate the changes in the Fields List as shown here: https://jsfiddle.net/flexmonster/qvc0wyfd/ 

Please let us know if one of the provided solutions works for you.

Best Regards,
Maksym

Public
Maksym Diachenko Maksym Diachenko Flexmonster February 21, 2023

Hello, Janez!

Hopy you are doing well.
We are wondering if you had time to look through the provided solutions for implementing a multy-currency report.
Please let us know if one of them would work for you.

Best Regards,
Maksym

Public
Janez February 21, 2023

Hello,
Thank you for your ideas. We like the most last option, with disabling apply but your logic is only for demo purposes, so we have to fine tune the solution. I have to work with our developers to finetune the solution.
Janez

Public
Maksym Diachenko Maksym Diachenko Flexmonster February 23, 2023

Hello, Janez!

Thank you for your reply.
We are glad to hear that the proposed idea worked for you. 
Feel free to write us if any questions arise.

Best Regards,
Maksym

Please login or Register to Submit Answer