Tableau: Trend chart Previous Years in Current Year

Use the following formula to display Current and Previous Years trend lines while having a Relative Date filter:

Relative Date: DATEADD(‘year’,DATEDIFF(‘year’,[Order date], today()), [Order date])

This formula will add 4 years to orders made in 2010 (if current year is 2014), 3 years to orders from 2011, 2 years for 2012, and 1 year for 2013. Therefore the year is 2014 for all rows, and the relative date filter is applied across all years of orders.
Have the new calculated field Relative Date as column and use existing Order Date as color distinction.

Recent Related Posts
Femke Kooij is a dashboard and report designer, developer and educator specializing in SAP | BusinessObjects Dashboards (better known as Xcelsius) and Crystal Reports. She has also a lot of experience with other SAP | BusinessObjects toolings like, Web Intelligence (WebI), Information Design Tool (Universe Designer), BusinessObjects Data Services (BODS) and the overall server platform BusinessObjects Enterprise (Launchpad, CMC). She spends a lot of her time thinking about and sharing her knowledge of Xcelsius to others through her own blog. Lately she is exploring other visualization tools like Qlikview and Tableau. On the later she is also posting some experiences. Currently she is in the employment of Cognizant Technology Solutions. Her blog only contains her personal views, thoughts and opinions. It is not endorsed by Cognizant Technology Solutions nor does it constitute any official communication of Cognizant Technology Solutions.

This entry was posted in Tableau and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>