Einstein Analytics Multicurrency

Fellow Trailblazers,

In this blog, I am focusing on one of the key topic ‘Multi-Currency’ handling in Einstein Analytics Cloud. This is one of the areas, which is still evolving in the product and have some gaps. At present Einstein Analytics does not support multiple currency. It only extracts the organisation default currency from ‘Analytics Integration User’ profile and does not convert to another currency at all.

I am hoping to see more coming from the product in the future releases on this topic (Safe Harbor). Nevertheless, there have been some work around already developed on this topic from our amazing trailblazers. Following the legacy, I am also sharing my learning & solution approach to handle Multi-currency use case in Einstein Analytics.

In addition, my focus is ‘Point-and-Click’ actions without writing a single line of CODE how you can perform these actions precisely and efficiently. Feel free to try this out and let me know your feedback.

 

“What gets measured, gets managed –  Peter Drucker”

 

Solution Overview:  I have recorded a small demo regarding the overall solution.

Demo Showcase :

 

Key Questions to think:

  • What if, if you are dealing with frequent currency conversion rate updates on a global level in your single org on a daily or weekly basis. Then this can be a really challenging task to keep up the pace with the reporting demands to supply on every level in the organization and display it on the dashboards on time.
  • What if, if you have a client or global use case from the banking vertical or financial investment. How important is for the senior or higher management to get the full holistic overview of their global offices’ revenue reports on currency fluctuations on hourly or daily basis?  How do you manage constant changes on the currency conversion from Salesforce and display it instantly in Einstein Analytics on a management cockpit with less operational overhead?

Further possibilities not covered –

  • In order to simplify this use case in the first step. I am not displaying any comparison graph or last vs current year rate differences. As this will require me to add additional snapshots to store those changes and compare those with the current ones. I will cover those types of use cases in a separate blog with more data points.

Key Objective: Displaying instant multiple currencies conversion rates changes impact on your measures calculation in Einstein Analytics  without data-flow operations.

Solution Approach:

  • Approach 1 – (Via SOQL & Static/Dynamic Bindings) – In this approach, which I found it very useful. Where based on SOQL Step (Salesforce Object Query Language) we can bring the conversion rates into an Einstein Analytics. Then setting up dynamic row index of my result binding from my SOQL based upon the selection of my currency static toggle. Therefore, if you have a new conversion rate changes in your salesforce environment at any stage. Then this can be directly displayed in your calculation without having a need to run a data-flow in Analytics cloud. This approach can be a good fit when you have a single org or can be useful for some multi-org use cases too. Indeed easy to maintain and can avoid data-flow & replication execution time conflicts. Below are the key steps to implement this approach –

 

                                                                                 Step 1: Currency Conversion Rate Definition – (Salesforce)
                                                                                 Step 2: Einstein Analytics SOQL Step – (Einstein Analytics)
                                                                                 Step 3: Einstein Analytics Static Step – (Einstein Analytics)
                                                                                 Step 4: SAQL & Binding of a Donut Chart – (Einstein Analytics)

 

Additionally, if you like to pass or bind number widgets for your number calculations in different currencies you can further extend the use case based upon your needs.  Below are the sample snapshots from my EA Dashboards (Snapshot Below).

Sample Dashboard 1

 

Sample Dashboard 2

 

  • Approach 2 – (Via Dataflow) – In this approach, we can extract the currency rate information from a standard ‘Currency Type’ object (SFDC digest) node. In addition, augmenting those results with the opportunity datasets & currency computed expressions. Then final resulting multi-currency opportunity dataset will be having several measures representing multiple currencies in a single row. So if you have multiple orgs or heterogeneous data sources this approach can be also a good fit. You can easily display your measures in a full overview with terms of several currencies. However, in case of any changes in your conversion rates then you have to run your replication & data-flow to display new rates updates on your EA assets. Indeed, it has overhead. Nevertheless, for complex scenarios this can be a good fit. (Not Covered in this blog and will write in my next sub-blog) 
  • Approach 1 & 2 – (Hybrid) – You can also combine both of the above mentioned approaches to create one. Solely depend upon your use case.

Let’s deep dive–

Solution Approach  – (Via SOQL & Static/Dynamic Bindings)

I am assuming you have the currency enabled in your instance. Also, check Analytics Integration user currency settings. This is a default currency for your org in Einstein Analytics environment. In my case, I am using USD as a default corporate currency in my example.

Step 1) Currency Conversion Rate Definition – (Salesforce)

Simply go to -> Set up -> Company Profile -> Manage Currencies

Then Press Manage Currencies and define your currency with its respective conversion rates. (Snapshot Below)

 

Step 2) Einstein Analytics SOQL Step – (Einstein Analytics) –

In this step, we will create a SOQL based step in Einstein Analytics in order to extract all of the active currencies.  I am currently filtering out all of the inactive currencies in my SOQL (For example- INR) so I can only bring the active ones or the relevant ones for my use case. In addition, if you have noticed results are alphabetically sorted in our table widget or in a sample sequence we have in Salesforce (Snapshot Below) –

SOQL json Sample

Below is the sample SOQL step to extract the currency exchange rates into our EA environment.

“soql_based_step”: {

“groups”: [],

“numbers”: [],

“query”: “SELECT currencytype.ConversionRate, currencytype.IsoCode FROM currencytype”,

“selectMode”: “single”,

“strings”: [

“IsoCode”,

“ConversionRate”

],

“type”: “soql”,

“useGlobal”: false

}

Step 3) Einstein Analytics Static Step – (Einstein Analytics) –

This is the crucial step in this approach. As we have our exchange rates in Einstein Analytics now. All I need to find out the business logic that can help me out identifying the country exchange rates based upon my toggle selection without hard-coding the conversion rate itself. If I would do that then this will give me the advantage to reduce the overhead of maintaining and increasing more EA adoption on this and automate the whole step.

Key advantages –

  • You can extract the exchange rates directly via SOQL and use those results further in your static steps to produce the measures calculation based upon those current rates.
  • You do not need to do any heavy lifting on your data flow at all :)) – (No Data flow)
  • Once you have your index values set initially in your static step. Then you can use this step to reflect your currency based calculations results on your EA component dynamically.

 

Static Step Creation – In this step, we will create a static step for your currency toggle and will set the default values starting from zero until four. I am using five currencies in total therefore; you can adjust the counts based upon your use case and the sequence. In order to simplify this approach, I have created my static step in the same order it has defined in my salesforce or SOQL with single selection required setting. (Snapshot Below)

Snapshot – Static Currency Step

Snapshot – Static Step json

 

Step 4) SAQL & Binding of a Donut Chart – (Einstein Analytics)

In this step, we just have to make the row index of the result binding to our SOQL step dynamic by using an additional selection binding to our SAQL.  That means when I select the CHF, which will parse the row index value 0 and we will be getting the first row from our conversion rate SOQL (CHF) as a result value and so on.

  • Over here Static_Step_1 is the name of my static step
  • soql_based_step is my SOQL step to retrieve exchange rates from Salesforce.

 Sample Syntax –

{{cell(soql_based_step.result,cell(Static_Step_1.selection,0,\”value\”),\”ConversionRate\”).asString()}}

 

Donut Chart:

Below is the SAQL json for donut chart with the bindings. (Snapshot Below)

Snapshot – Donut Chart

SAQL Query :

“query”: “q = load \”Opportunity\”;

q = group q by ‘Stagename’;

q = foreach q generate ‘Stagename’ as ‘ Stagename ‘,

sum(‘Amount’)*{{cell(soql_based_step.result,cell(Static_Step_1.selection,0,\”value\”),\”ConversionRate\”).asString()}} as ‘sum_Amount’;

q = order q by ‘ Stagename ‘ asc;

q = limit q 2000;”,

 

Conclusion

Using the SOQL step provide us to leverage the salesforce data access directly without scheduling any of the data flow jobs. User can simply toggle the currencies and control these switch in the same way in which they are executing it in the Salesforce CRM application. For the new audience on this  topic.I hope it gave you all a fair idea about handling multi-currency in Einstein Analytics.

Last but not least my sincere thanks to Roman who has been always a great support & mentor to me.

Let me know your feedback or suggestions.

 

Cheers!

Varun

4 thoughts on “Einstein Analytics Multicurrency

  1. Great blog as usual Varun, thanks for sharing ! Addition of the video is also really useful to watch the solution in context.

  2. Indrajeet Latthe June 24, 2019 at 9:56 am

    I’m little late to the show, can you please tell Multi Currency must be enabled to achieve this?
    What if I don’t have it enabled but still I want to conditionally format number widget on dashboard to specific currency?
    Like I’m keeping exchange rate in custom field and keeping local currency(EUR,GBP,AED etc) in other.
    And I want them to get toggled on with static step with formatted currency.
    Is this possible?

    1. You can take the result of your custom field in a SOQL step and pass it to your step in a result binding to show the outcome, in the same way, I did it.

      Or set the value attribute of your static step with that conversion rate (hardcoded) then bind the value to your widgets in your SAQL. Indeed this will come up with some overhead to maintain and update the rates from time to time.

      EA is still evolving around this feature and have some gaps. Therefore, in a complex use case where you might want to append those conversion values for your dataset rows or more fluctuation in your currency then I would prefer to store in a separate table and handle my all heavy lifting within my dataflow. Or you can handle it via APEX, nice article by Eric Schultz on this – Link

      Hope this helps.

Leave a Comment

Your email address will not be published. Required fields are marked *