8 Replies Latest reply on Nov 22, 2013 8:02 AM by Xiang Lin

# Overlay 3 line graphs in tableau

I have a sales ticker that tracks the hourly sales for the past 7 days and I would like to add the same 7 days from the year previous and from the previous week. I figured out a way to overlay one item but I can't figure out a way to overlay previous year and previous week over the current week. Does anyone have any tips on overlaying multiple items?

As you can see in the picture below, since the dates are all different, the line graphs are all showing up at different points along the graph. I would like The previous year and previous week to be laying on top of the current week.

• ###### 1. Re: Overlay 3 line graphs in tableau

Hi Melisa,

You have to make weekdays on axis (instead of actual dates) to achieve the goal.

1 of 1 people found this helpful
• ###### 2. Re: Overlay 3 line graphs in tableau

That is helpful. It's good to know that I could do that, however, with that method I can't figure out a way to keep the ticker to track the sales for each hour for each day. I am also having issues getting the previous year on that same graph you attached to your comment

• ###### 3. Re: Overlay 3 line graphs in tableau

Attached document just created to simulate the current week and previous week overlaying technique.

• ###### 4. Re: Re: Overlay 3 line graphs in tableau

Here is the packaged workbook.

• ###### 5. Re: Re: Re: Overlay 3 line graphs in tableau

Please check the attached and let us know if you have any questions.

• ###### 6. Re: Re: Re: Overlay 3 line graphs in tableau

Is there any way to factor in the leap year automatically in the week previous year formula

• ###### 7. Re: Re: Re: Overlay 3 line graphs in tableau

Yes, you can use the below logic in a formula to find the leap year then add the appropriate adjustments.

1.If the year is evenly divisible by 4, go to step 2. Otherwise, go to step 5.

2.If the year is evenly divisible by 100, go to step 3. Otherwise, go to step 4.

3.If the year is evenly divisible by 400, go to step 4. Otherwise, go to step 5.

4.The year is a leap year (it has 366 days).

5.The year is not a leap year (it has 365 days).

• ###### 8. Re: Overlay 3 line graphs in tableau

Hi .Indumon, on your attached sample file, is there a way to plot one graph in lines, and the other in bars or other graph types? I know on combination charts you could have different chart types but it only supports two graphs over-laid (ie, dual axis).

Thanks.