Introduction
QTD – Quarter to date is the period starting from the beginning of the current calendar quarter and ending at the current date.
While
PQTD - Previous quarter to date is the period starting from the beginning of the last calendar quarter and ending at the current day of the last quarter.
In this short article, I’m going to showcase several ways you can compute QTD and PQTD in Tableau.
Computing QTD and PQTD in Tableau
Using the Sample-Superstore dataset, I’ll be computing QTD sales and PQTD sales using the following calculations.
Note for reference purpose this article was written on 28/11/2022, and therefore all these computations are based on that date as the current date i.e., TODAY ().
Computing QTD Sales
There are several ways you can compute the QTD sales - as shared in the following three examples.
Notice, when you drag these three calculations to the text/label shelf returns similar value (194,792) - which is the Sales generated between the start of the 4th quarter and the current date (28/11/2022).
Computing PQTD Sales
To compute the PQTD sales use any of the following calculations.
Notice, adding the above calculations to the text/label shelf returns similar value (106,721), which is the sales generated between the start of the 3rd quarter and the current day in the 3rd quarter which is 28/08/2022.
Note you can replace the date of today (TODAY ()) in the above calculations with the latest date in your dataset should you wish to have computations based on the latest date in the Tableau data source.
You can compute the latest date in your data source using the following calculation.
Conclusion
I believe one of the above calculations will serve your purpose in computing QTD and PQTD respectively.
If this post was helpful and you would like to receive more of these Tableau tips and tricks, kindly subscribe to our mailing list below.
If you like the work we do and would like to work with us, drop us an email on our Contacts page and we’ll reach out!
Thank you for reading!