Tableau Dynamic Big Data Through REST Call

Anthony Alteirac
4 min readDec 11, 2020

--

Photo by rawkkim on Unsplash

Hey hey hey !

Today I’ll try to describe a very interesting use-case and how to deal with it thanks to Tableau and Advanced Analytics

Discover Tableau Advanced Analytics here: https://www.tableau.com/learn/whitepapers/advanced-analytics-tableau

In a nutshell Tableau Advanced Analytics is designed to call an external service, providing contextualised workbook data, for advanced and dynamic calculations. Think about AI/ML models you want to run on your data and visualise the result in Tableau, live when exploring data, taking into account your filters and selections, then Tableau Advanced Analytics is right for you!

But it can do far more than AI, ML, R advanced functions and I’m sharing only one use case, among hundreds, Tableau Advanced Analytics can solve.

Lets’ imagine you have an IOT time series oriented workbook, your data source is aggregated for human analysis purpose.

Imagine now that you want to give your end-user the ability to see details on one sensor (selected in the workbook) for a very specific time frame (again defined by selections in the workbook), for example only one or two days for a specific sensor. Those details are stored in a massive historical DB (several petabytes) only reachable with REST call.

You can’t predict the sensor and date user will want, you can’t call it directly, you can’t load the entire DB. Houston we’ve got a problem !

The use-case can be summarised like this:

Here’s where Tableau Advanced Analytics will help you!

What do you need ?

Setup Tableau Desktop to access your TabPy server

Add the IP of your Tabpy server and PORT (9004 by default)

Setup an Index to control the number of points you want to get back from the REST API

Just create an excel or an isolated Table with as much index you need, the maximum points you want to get from your REST call:

My excel has 5000 entries, cost only few KB

In your workbook, add the file:

Make sure your [index] field is set as dimension:

Now you need to call REST API with

  • [Start date], as parameter
  • [End date], as parameter

And to be sure it retrieves the number of points you need (arbitrary number, can be hardcoded or defined with a parameter, here we’ll use a parameter so the end-user can change it)

  • [NumberOfPoints], as parameter
  • Create the calculated field to get the date from REST API, passing the start and end date, see red rectangles in the below picture, of course you’ll need to adapt the script for your REST API:

Make sure you set the “Default Calculation” to “index”:

and

  • Create the calculated field to get the Sensor value from REST API, passing again the start and end date:

Make sure you set the “Default Calculation” to “index”, exactly like the previous calculated field.

  • Now you can build the viz as follows!

Show filters for the 3 parameters so the end-user can change them:

Houston, problem solved !

Tribute

  • My great customer contact who has taken time to explain his need in details, hopefully he will recognize himself ;-)
  • Alex Eskinasy for helping me on the Tableau side, with great ideas to improve the whole system !

--

--

No responses yet