AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Tableau prep workflow12/26/2023 ![]() When the API’s server receives our request, it will send back a short message with a status code, indicating whether the request was successfully received.For example, in this project we will send a GET request to retrieve EUR to GBP exchange rates for October 2020. These requests can have several methods including GET (to retrieve data from an API server), POST (to send data to an API server), DELETE (to delete data from an API server). Once we understand the structure of the API and how to access it, we need to form and send our request specifying the data we want to retrieve. For example, the Foreign Exchange Rates API I use in this project is free and can be accessed as many times as needed without a password. When we work with APIs, we start by looking at its documentation to understand what data is available to us, if there is a maximum number of requests we can send, whether this API requires authentication or payment, etc.If you know about APIs, then feel free to scroll further to the first step. API refresherīefore we start, I wanted to note some main features of APIs to make sure the following explanation is clear for everyone. Here are the webinar’s slides and its recording. I presented this topic at the Focus on Prep webinar by The Information Lab in November 2020. ![]() Add the Script step in your Tableau Prep flow to retrieve data from the API.Connect Tableau Prep Builder to the TabPy server.Write a Python script with the logic of the request.The overall process can be divided into six steps: If you are frequently working with data in different currencies, you can use this API to bring the relevant exchange rates directly into your Tableau Prep workflow to convert all values into the base currency. In this post I’ll show how to use Python to connect to the Foreign Exchange rates API in Tableau Prep Builder. ![]() However, it can be done by adding a Script step to your workflow, and using a Python or R script to extract the data. For example, if you need to analyse intraday stock price data, it’s more efficient to pull the most recent data from a relevant API instead of downloading a static file and refreshing it in your Tableau Prep flow every couple of hours, or even more frequently.Īt the time of writing (February 2021), it’s not possible to connect to an API directly from Tableau Prep Builder. ![]() Such APIs allow to programmatically connect to a remote server and retrieve only the data that you are interested in. However, organisations are increasingly making their data available via specifically designed APIs (Application Programming Interfaces). But what if we want to add third-party data to our analysis? Sometimes such data comes in the form of static CSV or Excel files that we need to download first and then connect to in Tableau Prep Builder. Usually, to work with data in Tableau Prep Builder, we directly connect to a file or a database. ![]()
0 Comments
Read More
Leave a Reply. |