EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login

Tableau Window Functions

By Priya PedamkarPriya Pedamkar

Home » Data Science » Data Science Tutorials » Tableau Tutorial » Tableau Window Functions

Tableau Window Functions

Introduction to Tableau Window Functions

Tableau’s versatility as a BI tool is proven by many of its capabilities. One such capability is the functionality of Windows functions. Windows functions are those functions that allow us flexibility while working with data calculations. What these functions do is similar to the operations performed by the OFFSET function in Excel. These functions truly enhance Tableau’s capability as a BI tool. Though they work along similar lines, in order to understand the application of Windows functions, each of them must be experimented in different contexts.

Working with Window Functions in Tableau

1. First load the dataset. For that click on “New Data Source” under Data Menu as shown below.

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

Tableau Window Functions 1

2. In the Connect section select the requisite data source type. In this case, it is clicked on “MS Excel”, so click on “Microsoft Excel” as shown below.

Tableau Window Functions 2

3. Select the requisite Excel file from the location it is stored at and open it to load into Tableau as illustrated below.

Tableau Window Functions 3

4. When the above steps are followed properly, the data gets loaded into Tableau and can be seen in the Data tab.

Tableau Window Functions 4

5. The requisite dimensions and measures in the dataset can be seen in the respective sections. This is as shown below.

Tableau Window Functions 6

6. To begin with, bring region dimension into Rows region and drag ‘Sales in Million’ measure over Text in marks card. We get a table giving region-wise sales as can be seen in the below image.

Tableau Window Functions 7

7. In order to demonstrate the application of Windows functions, we first need to create a calculated field. Now, right-click anywhere in the blank space under the Data tab. In the pop-menu, click on “Create Calculated Field” as illustrated in the following image.

Tableau Window Functions 8

8. When we follow the above step, we are navigated to the calculated field pane, as shown below.

Tableau Window Functions 8

9. Click on the arrow in the calculated field pane, it takes us to all the available functions in Tableau. Scroll down to discover all the available Windows functions. The following image highlights the windows functions available in Tableau. Click on any of the Windows functions to know more about it.

Tableau Window Functions 9

10. Selecting a particular function gives its information in detail. As can be seen in the below image, when we select the WINDOW_SUM function, Tableau gives us complete detail about the function.

Tableau Window Functions 10

11. We shall employ this function and understand its use. Double click on it and it is brought into the calculated field pane as can be seen in the following image. As we can see, this function essentially takes three arguments viz. expression, start and end. “expression” refers to any mathematical expression that we want to pass. The start and end parameters are what basically makes the windows function differently than normal functions. They allow us to select the requisite portion of data in a column. We shall understand the use of these parameters in detail in the coming part. Observe the following image carefully.

Popular Course in this category
Tableau Training (4 Courses, 6+ Projects)4 Online Courses | 6 Hands-on Projects | 39+ Hours | Verifiable Certificate of Completion | Lifetime Access
4.5 (6,121 ratings)
Course Price

View Course

Related Courses
Business Intelligence Training (12 Courses, 6+ Projects)Data Visualization Training (15 Courses, 5+ Projects)

Tableau Window Functions 11

12. For the expression argument, we passed the SUM(Sales in Million) function. The Window functions take aggregate functions as arguments and work on them.

Tableau Window Functions 12

13. Let’s name the above-calculated field as “Applied_Total”, and click on Apply and then on OK. We can find the newly created calculated field in the measures section as highlighted in green. We shall bring it into analysis.

img 13

14. We brought it into the analysis as can be seen in the following image. What we can see is that we got total sales for all the regions, because we had embedded SUM function in WINDOW_SUM function.

img14

15. Now, we want total sales except that of the Central region. We can exclude the sales of the Central region using the WINDOW_SUM function. Closely observe the implementation as shown below. Now, we passed the start and end parameters. Here FIRST() and LAST() functions have been used. They do nothing but give the first and last position in the column. FIRST() + 1 means that sum operations will start from the second row i.e. from the row containing data for East region. LAST() means the calculation will happen till the end. So, we get total sales excluding that of the Central region.

img 15

16. Once done, click on Apply and then on Ok. Bring the updated Applied_Total calculated field into the analysis, and we get the figures as shown below.

img16

17. Now, we are interested in comparing the sales for the five regions with the average of the sales of the regions of North and South. Here, we shall be using the WINDOW_AVG function provided by Tableau. The implementation of the function is as shown in the following screenshot. Observer the start and the end parameters. We have moved two places down from above and one place up from below to get the sales average for the North and South regions only. Once done, apply the calculation and save the calculated field.

img17

18. Once the field is updated as described above, bring it into the analysis, and we get the required average figure. The following image shows this. Now, we can compare the sales of each region with that of the average sales of North and South.

img18

19. The following image shows the application of WINDOW_MAX function using the same process that we discussed in the preceding section. Here, we got the maximum sales from amongst East, North and South regions.

img19

20. Just observe the following image closely. We implemented the WINDOW_MEDIAN function. The median function gives us the middle value. Observe the start and the end parameters. We chose to have a median for the East and North regions. We should cross verify the results with manual calculations to validate that the function has worked correctly. The way these Windows functions have been implemented, in a similar way all other Windows functions can be implemented. However, it is always good to have knowledge of the concept before the implementation.

img 20

Conclusion

Window functions are just variants of the normal forms of these functions. Tableau by providing us Window functions makes things easier for us especially in situations that involve working with a select portion of data. These functions must be worked with various examples to understand them properly.

Recommended Articles

This is a guide to Tableau Window Functions. Here we discuss the introduction and how does window functions work in tableau with its detailed explanation. You may also look at the following articles to learn more –

  1. Hierarchy in Tableau
  2. Group in Tableau
  3. Tableau Versions
  4. Tableau Dynamic Parameters
  5. Guide to Max Function in Python

Tableau Training (4 Courses, 6+ Projects)

4 Online Courses

6 Hands-on Projects

39+ Hours

Verifiable Certificate of Completion

Lifetime Access

Learn More

0 Shares
Share
Tweet
Share
Primary Sidebar
Tableau Tutorial
  • Functions
    • Tableau Functions
    • Tableau String Functions
    • Concatenate in Tableau
    • Rank Function in Tableau
    • Tableau Aggregate Functions
    • Tableau Date Functions
    • Window Sum Tableau
    • LOD Expressions in Tableau
    • LOOKUP Function in Tableau
    • Tableau Fixed Function
    • Tableau Count Distinct
    • Tableau Window Functions
  • Basic
    • What is Tableau
    • What is Tableau Dashboard
    • What is Tableau Server
    • Uses of Tableau
    • Tableau Versions
    • Tableau Architecture
    • Is Tableau Free
    • Tableau New Features
    • How To Install Tableau
    • How to Use Tableau?
    • Install Tableau Server
    • Tableau Commands
  • Charts
    • Tableau Charts
    • Tableau Chart Types
    • Donut Chart in Tableau
    • Funnel Chart in Tableau
    • Gantt Chart in Tableau
    • Bubble Chart in Tableau
    • Pareto Chart in Tableau
    • Sankey Chart In Tableau
    • Stacked Bar Chart in Tableau
    • Tableau Bullet Chart
    • Waterfall Chart in Tableau
    • Line Chart in Tableau
    • Heat Map in Tableau
    • Histogram in Tableau
    • CrossTab in Tableau
    • Treemap in Tableau
    • Trend Lines in Tableau
    • Tableau Reference Lines
    • Tableau Dual Axis
    • Legend in Tableau
    • Pie Chart in Tableau
    • Tableau Storyline
  • Statement
    • Tableau IF Statement
    • Case Statement in Tableau
  • Sort/Filters
    • Sorting in Tableau
    • Filters in Tableau
    • Types of Filters in Tableau
    • Tableau Action Filter
    • Context Filter in Tableau
    • Tableau Parameter Filter
    • Adding Filters in Tableau Dashboard
    • Tableau Context Filter
  • Tableau Dashboard
    • Dashboard in Tableau
    • Tableau Dashboard Creation
    • Tableau Dashboard Design
    • Tableau Workbook
  • Advanced
    • Tableau Reporting
    • Tableau Reporting Tool
    • Conditional Formatting in Tableau
    • Data Blending in Tableau
    • Parameters in Tableau
    • Tableau Data Sets
    • Tableau Drill Down
    • Tableau Dynamic Parameters
    • Tableau Table Calculation
    • Tableau Visualization
    • Tableau Joins
    • Pivot in Tableau
    • Data Visualization With Tableau
    • Forecast in Tableau
    • Map Layers in Tableau
    • Group in Tableau
    • Tableau Group by
    • Hierarchy in Tableau
    • Sets in Tableau
    • How to create a Set in Tableau
    • Tableau Order of Operations
    • Tableau User Group
    • Tableau Calculated Field
    • Custom SQL in Tableau
  • Interview Questions
    • Tableau Interview Questions

Related Courses

Tableau Certification Course

Business Intelligence Courses

Data Visualization Courses

Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

© 2020 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA Login

Forgot Password?

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you
Book Your One Instructor : One Learner Free Class

Let’s Get Started

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

Special Offer - Tableau Training (4 Courses, 6+ Projects) Learn More