.ultrageek. Computers, Music, and Thoughts


Wave / EA: Counting the number of weeks, months, days, etc. in SAQL

This was for some reason harder than it should have been. Needed to create the number of weeks from the beginning of the year to today. Re-posting this really because there are not a lot of examples out on the web.

date_diff("week",toDate("2018-01-01","yyyy-MM-dd"), now()) as 'YearlyGoal'

I will go back later to make the start of the year to be dynamic but for now this will do. Also watch out for this quote: “ instead of " in the examples. It will total throw an error that will point you in the wrong direction.

Love Wave and EA but wish their community was more open like StackExchange, searching is dreadful and requires a login but this was the article that I used to troubleshoot: https://success.salesforce.com/_ui/core/chatter/groups/GroupProfilePage?g=0F9300000009MBPCA2&fId=0D53A00003dGrNGSA0


Tagged as: , No Comments

Adding New Opportunity Record Type to Wave Sales App

We created a new Opportunity Type over the weekend and I assumed that it would just magically get added to the Opportunity dataset that the default Wave Sales App builds out but no, the dataflow/dataset was missing all the records related to the new record type. Creating a new dataset showed the data so I knew it was the dataflow somehow.

This is a braindead post to remind folks that if you create a new Opportunity record type and use the Salesforce.com default Wave App that you have to go in and update the dataflow JSON in about 4 places depending on the options you picked when you created the App.

These are the nodes:

  • Opportunity_Custom_Filter_Flag
  • Activity_Custom_Filter_Flag
  • Pipeline_Trending_Custom_Filter_Flag
  • Opportunity_Products_Custom_Filter_Flag

I recommend just downloading and updating the sections using a JSON editor like this one.


Embedding Wave Dashboard in to VisualForce page with Filters

This is a post on how to successfully embed a Wave dashboard in Visualforce with multiple datasource filters in Summer 17. If you found errors, fixes, or need help please comment and I'll respond/update the post, thanks!

Wave err...Einstein Analytics as Marketing has now re-branded Wave, is a little spotty on documentation. It assumes you drive the same way to and from work everyday so as you would expect it is a little lacking flexibility for the million other ways you could use the functionality. Recently I wanted to give users an Account Analysis dashboard without having to completely redo the Account Page since not everyone has a Wave license. One quick solution was to create a VisualForce page that was filtered on one Account with multiple data sources using a custom link from the Account Page to the custom VisualForce page. The challenge other than documentation that does not work in the live system was multiple datasets.

This is the documentation page that as of Summer 17 actually does not work (v40.0): https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_wave_dashboard.htm

This is the page that provides the clue: https://success.salesforce.com/issues_view?id=a1p3A0000008gVeQAI

Couple of tips:

  • You do not need to create a list on the dashboard as the documentation states. It is nice to provide to your users in case they want to switch Accounts but is not critical for this working.
  • "Connect Data Sources" will not allow you to filter just one dataset and cascade to the other datasets.
  • Creating Links with "Apply Selections and Filters" checked will cause issues. When I tried under Summer 17 it will unfilter my parent dashboard or not work at all.

Results may vary and I'm hoping with hotfixes and releases this is fixed but for Summer 17 on July 9th 2017 this is how the system works.

And here's the details:

And here's the full example page. Since it uses a standard controller it does not need a test class (WOOHOO!)


Wave Replication and Data Accuracy

In order to support custom dataflows you have to turn on 'Data Replication' and you want to create custom dataflows in order to allow better control over schedules, development, debugging, and insulation against dataflow failures due to changes, data, etc.

That being said you will want to disable incremental updates. Troubleshooting has several times come back to the Replication Object has stale data even though the data was changed hours or days before working the issue with replication and the dataflows running.

Some things to note:

  • New Records are picked up immediately
  • Changes could take an hour before getting picked up
  • Replication counts against the 24 dataflow limit

This might come across as negative but I am not sure why the replication settings give you the option to run hourly if it's going to cause a limits issue. I have 5 Dataflows plus replication and can only run a refresh once a day.

Use this resource to disable replication: Extract Data Incrementally in Replication

Or basically add this to your dataflows right before the fields: "incremental": false,