This content has been marked as final.
Show 2 replies
-
1. Re: Sales by previous year and current year
Vincent Baumel Jun 29, 2016 9:53 AM (in response to J Jack)It sounds like you need a calculation that splits off the final two characters of your dimension field. This would give you a separation of year and week. Here's how I mocked it up:
- Created an excel spreadsheet with a column labeled Week and rows ranging from 201501-201652, turning around from 201552 to 201601, and a column labeled Sales with randomized data for each row
- Connected to the spreadsheet in Tableau
- Converted the Week field from numeric to string
- Created a calculation field called Year that reads like this: LEFT([Week], 4)
- Created a calculation field called WeekNumber that reads like this: RIGHT([Week], 2)
- Switching over to Sheet 1, drag WeekNumber onto Year to create a hierarchy
- Drag the "Year, Week" hierarchy to the Rows shelf, and Sales to the Columns shelf
Now you can drill in and explore your data! Let me know if this helps.
-
2. Re: Sales by previous year and current year
J Jack Jun 29, 2016 10:37 AM (in response to Vincent Baumel)Thanks a lot ! I don't want to separate the week, but I got the logic !
J