2

Description:

We are using Einstein Analytics to create more insight on products our customers have, this requires creation of Einstein Analytics dataflows, datasets, dashboards and apps.

We have a use case to help our users understand profitability/loss at first sight. In order to achieve this goal, we created a dataflow to collect the data on project daily. This project includes data such as exchange rate of the day, price of the product, volume of sales and revenue and a date.

Sample Snapshot Comparison

Problem:

The dataflow we created stores the data in a table and extends the table by adding new rows, daily. We aim to store 365 snapshots, so the last 365 days. Currently we can use the analytics dashboards to display the snapshot details side by side.

Sample Chart View

Questions:

We are seeking answers for which path to follow. (1) What would be the best practise to show such a change using Einstein Analytics? Using what type of charts with what kind of customisations? (2) Would it make sense to calculate the difference using the dataflow and store them on the table?

Update: 24.07.2018

Using the compare table I managed to create the logic to have two different revenue sums and the difference in between as change.

Snapshot Comparison

However now I fall into an another problem. In the dataset, I have an extra field called 'Snapshot Date in Text' to enable the user pick multiple dates for comparison within dashboard. However in this use case, I need two fields for selections of 'Snapshot Date' as 'Select Snapshot #1' and 'Select Snapshot #2'.

As expected the filters are overriding each other, so I can't really associate the 'Select Snapshot #1' selection with 'Sum of Revenue Snapshot #1' and 'Select Snapshot #2' selection with 'Sum of Revenue Snapshot #2'.

To fix this, I thought about creating another dataset and combine them using SAQL statements. However I fall into an another issue.

Two identical datasets approach

The C field is not correctly calculated since I can make to values in the same row. Any ideas how to fix any of the issues above?

  • 1
    You will need to change the table to not facet based on other widgets. Then use binding statements to link each date to the filter. I wrote a blog post a while ago on how to do this in compact form - blog.canntechnology.com/2017/03/… – Carl Brundage Jul 24 '18 at 15:09
  • Thank you! I read your blog post, indeed is it very similar to what I need. The only difference is I only need to have one chart which has to show two bars, each bar has to be filtered by one of two listselectors. Listselectors actually have String values which are transformed from another date field. Somehow I couldn't bind the listselectors within the JSON to the filters. – ACP Jul 25 '18 at 13:39
  • is this binding not correct? "filters": [ [ "SnapshotDateText", [ "{{row(SnapshotDateText_3.selection, [0], [\"SnapshotDateText\"]).asString()}}" ], "in" ] ] – ACP Jul 25 '18 at 14:16
  • Just wrote a new question where I explained it in more detail salesforce.stackexchange.com/q/226605/52433 – ACP Jul 26 '18 at 14:59
1

It seems like this could be done with a compare table and KPIs on a dashboard.

For example, column A in a compare table is yesterday's data. Use a relative date filter to get the data from "day - 1" to "day - 1".

Column B would be todays data, also with a relative date filter of today to today.

Column C would be a formula of B-A to get the differences. You could go a step further and use conditional formatting on Column C. Negative values could be in a red text and then positive in green.

Lens

  • Note: I am showing months in the filter as I don't have days

For the dashboard, you can drop a couple of KPIs. The first would show today's profit. The second, which you could make smaller would use Column C with the Change

KPIs on a dashboard

You could even get more advanced and build a SAQL statement that dynamically generates the text based on whether the change is positive or negative. You can add characters like ▲ or ▼ to the text as well. Then use a binding statement to dynamically change the label of the KPI widget.

If you need more flexibility with the date that is used, add a date picker or list of dates in a select to the dashboard. A binding statement can dynamically change the filter based on the selected date.

Alternatively, if you are looking to show each date and the change from the previous as a line or bar chart, you would want to add the differences to the dataflow.

Take a look at the computeRelative transformation. It would allow you to find the previous days record in the data flow. You can pull the value into the current record. Then use a computeExpression to calculate the difference.

Be sure to take into account cases where you don't have a value (nulls) and use a coalesce statement to turn null into 0.

  • When I think of a variance analysis, I think of something similar to "volatility" in the stock market or the mean vs the standard deviation from a mean in a Gaussian distribution. I'm not seeing where your method returns that type of "cumulative variance". – crmprogdev Jul 23 '18 at 13:12
0

Using the suggestions of Carl Brundage, I modified the compare table, disabled the faceting and bound the steps with list selectors in a custom fashion. The bottle neck was the binding filters and the steps.

Here is my complete answer to the question.

You can check the other question I posted Binding (and Filtering) two listselectors independently with an Einstein Analytics Chart.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.