BlogPythonTableauUncategorized

TabPy Tutorial: Integration of Python in Tableau

untitled-design

This tutorial will give a walk through the installation and connecting Tableau with TabPy. After this tutorial, one will be able to execute a simple python function from Tableau to perform some analytics calculation such as correlations etc

1. Installation of Python and TabPy

Windows Users:

https://github.com/tableau/TabPy

Download this official TabPy Integration from above link. Open the TabPy-master folder and click on setup.bat to start the installation of TabPy.  See below image.

 

tab1
click on setup.bat / setup.sh to start installations

 

After clicking on setup.bat, System will look for any previous installation of Anaconda at port 9004. You will see below screen:

tab2

2. Connecting Tableau to TabPy.

Go to Help > Setting and Performance > Manage External Service Connection

tab2

tab3

3. Python code to a Calculated Field

You can invoke Calculated Field functions called SCRIPT_STR, SCRIPT_REAL, SCRIPT_BOOL, and SCRIPT_INT to embed your Python script in Tableau:

tab4

4.  Use Calculated Field in Tableau

Now you can use your Python calculation as Calculated Field in your Tableau worksheet:

tab6

Thanks,

Reckon Analytics

Please do share with your friends!