Embedding R Plots in Tableau Dashboards

“R you nuts?” is what my colleague asked me when I once proposed this little hack. He’s not completely wrong, we’ll get to that later…

The task I was presented with was to embed the graphical output from an R package in a Tableau dashboard. Of course it’s possible to run R code from within Tableau Calculated fields, you can read more about it in official Tableau resources here, here, and here and also here on my blog. But part of the game is that there is only one vector of data being returned from the R session via Rserve into a Table Calculation in Tableau. So what about some of the complex graphics R can produce? Sure, you can try to rebuild those natively in Tableau based on the data returned from the code. But what if a) you’re too lazy to do that (and also it’s all just about rapid prototyping something anyways), or b) the visualization is just too complex (think 3D brain models)?

Continue reading →

Scraping the IMDb for Use in Tableau

In the last quarter of 2016 the German marketing team came up with a great way to follow the immense success of last year’s Tableau Stadium Tour: the Tableau Cinema Tour! After visiting ten cities all over Germany, Austria, and Switzerland, we are now considering rolling it out all over Europe. Stay tuned for that! Since we often got requests for the data used in the main demo, I decided to produce this write-up of how to extract the data from the Internet Movie Database (IMDb). Unfortunately copyright reasons make it impossible for us to just provide you the ready-made data. That said, with this walk-through everybody should be able to get the data!

Continue reading →

Tatort (Quelle: ARD / daserste.de)

Hinter den Kulissen der Tableau Kino Tour – Teil 3: Die Tatorte

Nachdem ich in den beiden vergangenen Teilen dieser Serie gezeigt hatte, wie wir die IMDb-Daten (Teil 1) bzw. die Daten zu Filmreihen (Teil 2) extrahiert und in ein brauchbares Format überführt haben, möchte ich nun noch beleuchten, wie wir die Daten zur Analyse der Krimireihe “Tatort” gewonnen und bearbeitet haben. Für den “Tatort” als Untersuchungsobjekt haben wir uns entschieden, da es dazu Unmengen an Daten gibt (s.u.), da sich die Serie von verschiedenen Aspekten her analysieren lässt (die Serie wird seit vielen Jahrzehnten produziert, findet an unterschiedlichen geographischen Orten statt, involviert eine Menge an Ermittlern, Schauspielern, usw.), und da es eine der, wenn nicht sogar die beliebteste deutsche Fernsehserie ist. Und auch, weil ich selbst ein großer Fan bin und mich das Thema und die Daten auch ganz persönlich interessiert haben…

Continue reading →

Tableau: Ist der erste Film immer der erfolgreichste?

Hinter den Kulissen der Tableau Kino Tour – Teil 2: Die Filmreihen

Dies ist der zweite Teil in einer dreiteiligen Serie zu den technischen Hintergründen der Tableau Kino Tour. Teil 1 beschäftigt sich mit dem Auslesen und Nutzbarmachen der IMDb-Daten, hier geht es um Filmreihen, der dritte Teil wird sich mit den Daten zum “Tatort” beschäftigen.

In den letzten Jahren wurde es unter Filmstudios und Produzenten immer populärer, einen oder meist gleich noch mehrere Teile nachzuschieben, sobald ein Film erfolgreich war. Neudeutsch spricht man dann von einem Franchise – um nicht zu sehr in Anglizismen zu verfallen sprechen wir im Kontext der Tableau Kino Tour lieber von Filmreihen. Die Idee ist ja an sich auch nichts neues, mehrteilige Filme oder Fortsetzungen gibt es schon sehr lange. Man denke nur an “Star Wars”: Der erste Film 1977 wurde noch als einzelnes Werk konzipiert, dann wurden nach dem großen Erfolg zwei weitere Teile produziert, 16 Jahre später nochmals drei Teile, und dann wiederum 10 Jahre später nochmals drei Teile – wovon bisher allerdings erst einer tatsächlich veröffentlicht wurde, auf die restlichen beiden müssen wir uns noch ein wenig gedulden.

Continue reading →

Linear regression line in Tableau calculated by external R script

Run code from an external .R file in Tableau

Tableau introduced the R integration in version 8.1 back in 2013. That’s awesome because it opens up to Tableau the whole range of analytical functionality R offers. Most of the time the R code being triggered from within Tableau is rather short, such as a regression, a call to a clustering algorithm or correlation measures. But what happens when the code you want to run out of Tableau is getting longer and more complicated? Are you still bound to the “Calculated Field” dialog window in Tableau? It’s nice but it’s tiny and has no syntax coloring or code completion for our precious R code.

Run R code inline in a Calculated Field in Tableau

Run R code inline in a Calculated Field in Tableau

Continue reading →