![]() ![]() With a similar syntax breakdown, this is what the Python script for this would look like: On similar lines, you can also leverage the power of scripts to make API calls and analyze constantly changing data.įor this example, I will be using to make requests for obtaining the market data for the top 100 cryptocurrencies. Tableau Prep with its entire suite of connectors can pretty much connect to data coming from various databases/ big data warehouses in the form of SQL queries or Cloud services thus ensuring your dashboards are up to date depending on the refresh frequency. ![]() Case 2: Using Tableau Prep & TabPy to make API requests The script should now run successfully to process your dataset and clean it the way you defined it in your script. py file here and select the function name you defined. This should establish the connection as you see here. Select your server as localhost and Port as 9004 (what you got in the command prompt window) and hit Sign in. This will open up the Settings pane at the bottom where you will select TabPy Server and add the localhost connection by going to Help (at the top) > Settings & Performance> Manage Analytics Extensions Connection. TabPy Server Connection Details (Image by Author) It is in a format that needs to be changed to a more ingestible format for Tableau. Notice the Stands table which gives the list of which stands can be accessed by which gates at an airport terminal. My intention here is not to solve the challenge but to use an excerpt from this flow and show how the data manipulation could be achieved either with in-built features or using the Script feature. You can also download the source files, Tableau Prep flows, and Python scripts here in case you would like to follow along. I would strongly encourage you to go check this out if you want to challenge yourself with the best ways to prep data (& compare with the provided solutions). Case 1: Using Tableau Prep Features & Python Script interchangeably:įor this example, I have selected a dataset from the Week 48 Challenge. ![]() Tableau Prep allows you to handle these changes independently and transition into a cleaned output file for analysis. However, when you are dealing with data where fields might change (courtesy: collaborative worksheets) followed by a pivoting of rows to columns/ unpivoting of columns to rows, it becomes prone to breaking when the source file gets refreshed. For all the data prep nerds out there, I wanted to walk you through a couple of examples of when Scripts on Tableau Prep can prove to be extremely handy.įor most of the cases, Joins & Blends, Level of Detail (LOD) Calculations, and limited Data manipulation that Tableau Desktop allows might suffice. Does that sound like you? That was definitely me a couple of months ago until I discovered the power of scripts: a feature that was released just last year. Step 6: Exclude blank values from your new pivoted column.While Tableau Prep has been around for quite some time, not every Tableau user can vouch for using it extensively. Step 5: Remove the unnecessary Pivot Names field. Step 4: Pivot the Split columns using a Pivot step. Step 3: Remove the unnecessary, original concatenated column. Step 2: Split all values of the concatenated column into separate fields using a Clean step. Step 1: Connect to data with an Input step. Why: This makes it easier to perform analytics on the Service Type field, such as answering questions like, “How many people selected Financial Literacy?”Ībove: Service Types are concatenated in a single value per customerĪbove: Service Types are listed in one column with rows for each Service Type per customer Tableau Prep in Practiceīusiness Goal: How many customers have selected a specific service type?ĭata Goal: Rather than concatenating a customer’s selections in a single value (one row per customer), display all service type selections in a single column with one row per customer/service type combination (multiple rows per customer). ![]() I’ve created the following walkthrough to demonstrate just one of many data prep scenarios our clients have faced. Considering both performance and ease of use, prepping your data before it enters Tableau Desktop has many benefits. With the release of Tableau Prep in April 2018, analysts have been given an incredibly valuable tool for their analytical kit. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |