By: Eric Parker
Eric Parker lives in Seattle and has been teaching Tableau and Alteryx since 2014. He's helped thousands of students solve their most pressing problems. If you have a question, feel free to reach out to him directly via email. You can follow him on LinkedIn or sign up for a Tableau Office Hour to work with him directly!
Tableau is a great tool for operationalizing time period comparisons. One of the classics is comparing quarters.
For example, you might want to know how this quarter compares to last quarter. That's a great way to compare values if your business isn't very seasonal. However, what if you sell sunscreen? You can bet that comparing fall to summer is always going to look like a bummer.
That's where comparing a quarter to the same quarter from the prior year could be so helpful! Want to learn how you can write calculations to compare this quarter to date to the same quarter to date from last year? Check out this video!
Resources:
Calculations:
Sales - Quarter to Date:
IF DATEDIFF('quarter',[Order Date ],TODAY()) = 0
THEN [Sales]
END
Sales - PY Quarter to Date:
IF DATEDIFF('quarter',[Order Date ],TODAY()) = 4
AND [Order Date ] <= DATEADD('quarter',-4,TODAY())
THEN [Sales]
END
Want to keep learning foundational skills in Tableau? Sign up for our weekly newsletter so you never miss new blog posts, videos and events!