Data Science Toolbox: How to use Julia with Tableau

R allows Tableau to execute Julia code on the fly
R allows Tableau to execute Julia code on the fly

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

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 which 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 everytime 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 on 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:

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

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!

Photo from an early blog post: 2007 Hampi, a temple town in South India recognised as UNESCO World Heritage Site
Photo from an early blog post: 2007 Hampi, a temple town in South India recognized as UNESCO World Heritage Site (Flickr)

Woohoo, it’s already ten years since I started this blog. Can’t believe it! Thanks to all of those who read my posts, and who encouraged and inspired me. Without you blogging would be only half the fun! Now, let’s have a little recap…

2007-2009 SAP and India:

It all started in 2007. I was studying Computer Science, and decided to go for an internship abroad. China and India were on my short list. 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 loop.

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

2009-2012 CERN:

CERN, surrounded by snow-capped mountains and Lake Geneva, grabbed my attention during the end of my studies. CERN has tons of data: some petabytes! Challange 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.

2012-2015 Capgemini and MBA:

Back in Germany, I wanted to bring 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 usecases for the financial sector, and gave advice for digital transformation inititives.

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

2015-201? Tableau and Futura:

I knew Tableau from my time as consultant. It is an awesome company with a great product and a mission: help people see and understand their data. That’s me! I joined Tableau to help organizations through the transition from classic BI factories 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?

Currently I’m looking forward to give 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… 🙂

Tableau Conference TC17 Sneak Peek: Integrating Julia for Advanced Analytics

Using Julia within calculations in Tableau (click to enlarge)
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.

Price and Sentiment Analysis: Why is Bitcoin Going Down?

Bitcoin Price and Sentiment Analysis with variable Moving Average: click to open interactive Tableau dashboard with annotations
Bitcoin Price and Sentiment Analysis with variable Moving Average: click to open interactive Tableau dashboard with annotations

Bitcoin has become one of the trendy investment assets in the recent years. Whenever bitcoin prices approach historical highs, every investor should watch the currency closely. Bitcoin rallied by more than 20% in the first days of 2017, crossing the $1000 mark for the first time since November 2013.

As many experienced bitcoin traders will remember, the first $1000 peak was a case of obvious over exuberance. Bitcoin was hot, plenty of money was pouring into it. Bitcoin investors got too excited, causing a price surge. Prices then rebounded and suffered a long-term collapse shortly after.

Moving Average Convergence/Divergence Indicator

Many traders rely on a Moving Average Convergence/Divergence (MACD) indicator. The MACD is a measure of the convergence and divergence between two EMAs (usually 12 and 26 days) and is calculated by subtracting the two of them. The signal line is constructed by creating an EMA (usually 10 days) of the signal line.

The signal line crossing the MACD from above is a buy signal. The signal line crossing the MACD from below is a sell signal. Relying only on momentum-based indicators (such as the MACD) and optimization-based models, however, will most certainly fail to indicate heavy price drops, as the drop in late 2016.

Predicting Fear with Sentiment Analysis

In late 2016 a lot of people began to pour money into bitcoin again. This time because they were worried that stock markets and other assets were due for a drop. For investors, it is essential to figure out whether or not these fears are actually founded. However, such “safe assets” are prone to suffering from bubbles. People get scared, get invested into gold, or bitcoin, then realize that their fears were unfounded. As a result bitcoin prices could plummet.

So how to catch emotions such as fear in advance? Twitter is a valuable source of information and emotion. It certainly influences the stock market and can help to predict the market. Sentiment analysis can lead price movements by up to two days. Negative sentiment, however, is reflected in the market much more than positive sentiment. This is probably because most people tweet positive things about bitcoins most of the time. Even more positive news occurred after breaking the $1000 barrier.

This content is part of the session “Price and Sentiment Analysis: Why is Bitcoin Going Down?” that I deliver at the Frankfurt Bitcoin Colloquium. Have a look on my upcoming sessions!

[Update 14 Jun 2017]: Axis for Moving Average adjusted. Relative Date selector added with last 6 month as default. Screenshot updated.

Feel free to share the Bitcoin Price and Sentiment Analysis dashboard, which is also featured as Viz of the Day on Tableau Public: