13 Replies Latest reply on Aug 29, 2018 1:19 PM by Michael Gillespie

# Shift the 2 lines on the right to start at the same place

Hey guys,

I managed to plot 4 years worth of 18 month data on a graph. The problem is that some of the data starts too far to the right. I would like all of them to start at the same time . In the attached set the Enrollment 2018-19 starts on 13 when it should start at 1, and the Enrollment 2016-17 starts at 13 when it should also start at 1 and it wraps around, aka the 13-24 should be 1-12 and the 1-6 should be 13-18 (for the orange line). IF you have any advice for me I am all ears.

Best,

Eugene

• ###### 1. Re: Shift the 2 lines on the right to start at the same place

Eugene, you're explicitly telling Tableau to do it that way by using the "Use This" measure as your X-axis value.

Use MONTH(Date) instead (see sheet 2 in the attached workbook - 2018.2 format).

Is that what you're looking for?  Or is there a reason to use the "Use This" measure?

• ###### 2. Re: Shift the 2 lines on the right to start at the same place

The reason I do that is if you look at the data, its 18 month cycles. If we do the month thing it sums up data that shouldn't be summed up. Example January 2016 + January 2017 data. IT sums to 1 point and puts under January. That is why I numbered them so they would be different data points. That is why you have to use the use this measure and then I need help shifting the data a bit and readjusting!

• ###### 3. Re: Shift the 2 lines on the right to start at the same place

OK, so January 2016 is period 13 for the 2015-16 year, but period 1 for the 2016-17 year, right?

You need a lookup table.  First column is Date; 2nd column is Enrollment Year; 3rd column is Period (your current "Use This" value, sort of).  You'll have a duplicate row for the January periods, one for period 13 and one for period 1.

Use that table as the left side of join in the data source tab; join on Date and Enrollment (inner join, probably).

Now you can use the Period field as your X-axis and everything will line up properly.

• ###### 4. Re: Shift the 2 lines on the right to start at the same place

Sorry, you said 18 not 13!  My mistake.

Same approach, just push it out to 18 months instead of 13 in that spreadsheet.  You'll have more duplicate Date values but you can see how it works.

• ###### 5. Re: Shift the 2 lines on the right to start at the same place

Michael, I am attempting to do this, but I am running into some troubles with joining and implementing. Do you by chance have the tableau workbook I can take a look at? And yes jan is period 13 for 15-16 and period 1 for 16-17, all the way up to june!

Thank you!

• ###### 6. Re: Shift the 2 lines on the right to start at the same place

yes, if you can post your sample data Excel file, I can put together the join for you.

• ###### 7. Re: Shift the 2 lines on the right to start at the same place

Here it is

• ###### 8. Re: Shift the 2 lines on the right to start at the same place

I reformatted your main data to have a single column that indicates the enrollment year, and a single column for the enrollment values.

1 of 1 people found this helpful
• ###### 9. Re: Shift the 2 lines on the right to start at the same place

Michael,

How did you format my main data like that? The reason I ask is because in my main data set, I have a bunch of account names and a bunch of programs and campuses. I would love to know how you made it work so I can apply it to my main dataset.

Best,

Eugene

• ###### 10. Re: Shift the 2 lines on the right to start at the same place

All manual! you could probably do it in Prep.

Michael Gillespie

651-329-9638

• ###### 11. Re: Shift the 2 lines on the right to start at the same place

Ah Yes,

I don't think I could do it manually for like 30,000 lines of data haha.

Thank you though! At least now I know its possible!

• ###### 12. Re: Shift the 2 lines on the right to start at the same place

I DID IT! Thank you so much Michael.

I just pivoted it in tableau and it just worked. Thank you!!!!!!

• ###### 13. Re: Shift the 2 lines on the right to start at the same place

Happy to help!

Michael Gillespie

651-329-9638