From the course: Tableau and R for Analytics Projects
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Create a calculated field in Tableau
From the course: Tableau and R for Analytics Projects
Create a calculated field in Tableau
- [Instructor] One of the key techniques when it comes to integrating R in Tableau is to create a calculated field in Tableau that calls an R function. Rather than jump in and create that advanced kind of calculated field, I wanted to show you how to combine two fields within Tableau to calculate a value that is not included in your original dataset. We'll get to specific examples of using R later on in the course. The sample file that I'm using is 02_05_CalculatedField, and you can find it in the chapter two folder of the exercise files collection. Over on the left I have the navigation pane, and I have facts or dimensions about my data, such as the customer name, product category, and product name. And below that I have two values, price and quantity. So that is the price of the item that was purchased. We're assuming only one product per order, just to keep things simple, and then the quantity. What we don't have is…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.