Data Science Toolbox: How to use Julia with Tableau

Julia in Tableau: R allows Tableau to execute Julia code on the fly, enhancing your data analytics experience.
Julia in Tableau: R allows Tableau to execute Julia code on the fly, enhancing your data analytics experience.

Michael, a data scientist, who is working for a German railway and logistics company, recently told me during a FATUG Meetup that he loves Tableau’s R integration and Tableau’s Python integration. As he continued, he raised the question of using functions they have written in Julia. Julia, a high-level dynamic programming language for high-performance numerical analysis, is an integral part of the newly developed data strategy in Michael’s organization.

Tableau, however, does not come with native support for Julia. I didn’t want to keep Michael’s team down and was looking for an alternative way to integrate Julia with Tableau.

This solution is working flawlessly in a production environment for several months. In this tutorial, I’m going to walk you through the installation and connecting Tableau with R and Julia. I will also give you an example of calling a Julia statement from Tableau to calculate the sphere volume.

Step by Step: Integrating Julia in Tableau

1. Install Julia and add PATH variable

You can download Julia from julialang.org. Add Julia’s installation path to the PATH environment variable.

2. Install R, XRJulia, and RServe

You can download base R from r-project.org. Next, invoke R from the terminal to install the XRJulia and the RServe packages:

> install.packages("XRJulia")
> install.packages("Rserve")

XRJulia provides an interface from R to Julia. RServe is a TCP/IP server that allows Tableau to use facilities of R.

3. Load libraries and start RServe

After packages are successfully installed, we load them and run RServe:

> library(XRJulia)
> library(Rserve)
> Rserve()

Make sure to repeat this step every time you restart your R session.

4. Connecting Tableau to RServe

Now let’s open the Help menu in Tableau Desktop and choose Settings and Performance >Manage External Service connection to open the External Service Connection dialog box:

TC17 External Service Connection

Enter a server name using a domain or an IP address and specify a port. Port 6311 is the default port used by Rserve. Take a look at my R tutorial to learn more about Tableau’s R integration.

5. Adding Julia code to a Calculated Field

You can invoke Calculated Field functions called SCRIPT_STR, SCRIPT_REAL, SCRIPT_BOOL, and SCRIPT_INT to embed your Julia code in Tableau, such as this simple snippet that calculates sphere volume:


SCRIPT_INT('
library(XRJulia)
if (!exists("ev")) ev <- RJulia()
y <- juliaEval("
4 / 3 * %s * ' + STR([Factor]) + ' * pi ^ 3
", .arg1)
',
[Radius])

6. Use Calculated Field in Tableau

You can now use your Julia calculation as an alternate Calculated Field in your Tableau worksheet:

Using Julia within calculations in Tableau (click to enlarge)
Using Julia calculations within Tableau (click to enlarge)

Feel free to download the Tableau Packaged Workbook (twbx) here.

Further Reading: Mastering Julia

If you want to go beyond this tutorial and explore more about Julia in the context of data science, I recommend the book Mastering Julia. You can find it here.

Further Reading: Visual Analytics with Tableau

Join the data science conversation and follow me on Twitter and LinkedIn for more tips, tricks, and tutorials on Julia in Tableau and other data analytics topics. If you’re looking to master Tableau, don’t forget to preorder your copy of my upcoming book, Visual Analytics with Tableau. (Amazon). It offers an in-depth exploration of data visualization techniques and best practices.

Also, feel free to comment and share my Tableau Julia Tutorial tweet:

Social Media and the Customer-centric Data Strategy #data17 #resources

Social media marketing mix
Do you analyze your social media marketing mix? | Photo Credit: via Richard Goodwin

With over 3 billion active social media users, establishing an active presence on social media networks is becoming increasingly essential in getting your business front of your ideal audience. These days, more and more consumers are looking to engage, connect and communicate with their favorite brands on social media.

Adding social media to your customer-centric data strategy will help boost brand awareness, increase followership, drive traffic to your website and generate leads for your sales funnel. In 2017, no organization should be without a plan that actively places their brand on social media, and analyzes their social media data.

Once you’ve started diving into social media analytics, how do you bring it to the next level? This session covers a customer-centric data strategy for scaling a social media data program.

Here are the links (i.e. additional resources) featured during the session to help you formulate your social media data program in order to build a stronger presence and retrieve powerful insights:

The Data Opportunity

TC17 Social Media Slides: The Data Opportunity

Focus on relevant metrics for your strategy

TC17 Social Media Slides: Sentiment Analysis

How to get Social Media in Tableau?

TC17 Social Media Slides: 3rd Party Platform Talkwalker

Tips to Level Up

TC17 Social Media Slides: Unshorten URLs in Tableau with R

Tutorials and Slide Set

The slides and tutorials presented at Tableau Conference on Tour in Berlin are also available on SlideShare, and on YouTube in English and German.

English Tutorials

German Tutorials

Slide Set

It’s My 10 Year Blogging Anniversary!

10-year blogging anniversary: 2007 Hampi, a temple town in South India recognised as UNESCO World Heritage Site
10-year blogging anniversary: 2007 Hampi, a temple town in South India recognized as UNESCO World Heritage Site (Flickr)

A Milestone Blogging Anniversary

It’s hard to believe, but I’m celebrating my 10-year blogging anniversary! I’m filled with gratitude for those who have read, encouraged, and inspired me throughout this adventure. Without you, blogging would be only half the fun. Now, let’s take a moment to reflect on this incredible decade…

The Early Years: SAP and India (2007-2009)

It all started in 2007 when I decided to explore an internship abroad in India. I was studying Computer Science and decided to go for an internship abroad. China and India were on my shortlist. I decided for India, applied for a scholarship, and asked some companies for interesting project work. Before starting the adventure, I published my very first blog post to keep family and friends in the loop.

For the next seven months, I lived in Bangalore and worked for SAP Labs India to develop prototypes for mobile BI apps. I spent plenty of weekends exploring India and surrounding countries. After returning from India, I continued to work for SAP at their headquarters while finishing my degree in Karlsruhe.

CERN: Data and Discovery (2009-2012)

Surrounded by snow-capped mountains and Lake Geneva, CERN grabbed my attention at the end of my studies. CERN has tons of data: some petabytes! Challenge accepted. CERN is known for its particle accelerator Large Hadron Collider (LHC). We applied machine learning to identify new correlations between variables (LHC data and external data) that were not previously connected. This chapter was all about embracing the challenges of big data.

Capgemini and MBA: Expanding Horizons (2012-2015)

Back in Germany, my focus shifted to bringing Big Data Analytics to companies. To one company? No, to many companies! So instead of getting hired as Head of BI for an SME, I started to work for Capgemini. I had fantastic projects, designed data-driven use cases for the financial sector, and gave advice for digital transformation initiatives.

In order to keep in balance with all the project work, I dedicated many of my weekends to studies and got enrolled in Frankfurt School’s Executive MBA program. During my studies, I focused on Emerging Markets and visited a module at CEIBS in Shanghai.

Tableau and Futura: Innovation and Entrepreneurship (2015-201?)

I knew Tableau from my time as a consultant. It is an awesome company with a great product and a mission: help people see and understand their data. That’s me! Joining Tableau allowed me to assist organizations in transitioning from classic BI to modern self-service analytics by developing data strategies so that data can be treated as a corporate asset. This includes education, evangelism, and establishing a data-driven culture.

In the evenings I’m working for Futura Analytics, a fintech startup, which I co-founded in 2017. Futura Analytics offers real-time information discovery and transforms data from social media and other public sources into actionable signals.

What’s Next? A Glimpse into the Future

Currently, I’m excited to present my Data Strategy talk on TC17, accompanied by a TensorFlow demo scenario. I’m also learning Mandarin, the predominant language of business, politics, and media in China and Taiwan, for quite a while. Let’s see if that is going to influence my next steps… 🙂

Follow my ongoing journey in data analytics and more on Twitter and LinkedIn.

Tableau Conference TC17 Sneak Peek: Integrating Julia for Advanced Analytics

Demo: using Julia within calculations in Tableau (click to enlarge)
Demo: using Julia calculations within Tableau (click to enlarge)

We have already seen some love from Tableau for R and Python, boosting Tableau’s Advanced Analytics capabilities.

So what is the next big thing for our Data Science Rockstars? Julia!

Who is Julia?

JuliaJulia logo is a high-level dynamic programming language introduced in 2012. Designed to address the needs of high-performance numerical analysis its syntax is very similar to MATLAB. If you are used to MATLAB, you will be very quick to get on track with Julia.

Compared to R and Python, Julia is significantly faster (close to C and FORTRAN, see benchmark). Based on Tableau’s R integration, Julia is a fantastic addition to Tableau’s Advanced Analytics stack and to your data science toolbox.

Where can I learn more?

Do you want to learn more about Advanced Analytics and how to leverage Tableau with R, Python, and Julia? Meet me at the 2017 Tableau Conferences in London, Berlin, or Las Vegas and join my Advanced Analytics sessions:

Will there be an online tutorial?

Yes, of course! I published tutorials for R and Python on this blog. And I will also publish a Julia tutorial soon. Feel free to follow me on Twitter @xlth, and leave me your feedback/suggestions in the comment section below.

Further reading: Mastering Julia

A German translation of this post is published on the official Tableau blog: Tableau Conference On Tour Sneak Peek: Julia-Integration für Advanced Analytics

Update 11 Oct 2017: The Julia+Tableau tutorial blog post is now published.

Take the Survey: The Stage of Digital Transformation

This survey is part of my thesis that examines the topology, structure, and evolution of the digital transformation within organizations. Your contribution to this survey helps to better understand the perception regarding the current stage of digital transformation.

Follow this link to take the survey:
https://goo.gl/forms/Yi2OUYaQfIBP9t3x2

Spread the word and share this article! Thanks!