{"id":230,"date":"2017-08-11T21:13:57","date_gmt":"2017-08-11T21:13:57","guid":{"rendered":"https:\/\/www.datahasbyte.com\/?p=230"},"modified":"2017-08-11T21:13:57","modified_gmt":"2017-08-11T21:13:57","slug":"workout-wednesday-week-32-continuous-dates","status":"publish","type":"post","link":"https:\/\/www.a-j-c.com\/welcome\/2017\/08\/11\/workout-wednesday-week-32-continuous-dates\/","title":{"rendered":"Workout Wednesday Week 32: Continuous Dates"},"content":{"rendered":"<p>This week&#8217;s #WorkoutWednesday challenge (available <a href=\"http:\/\/www.womanindata.co.uk\/2017\/08\/workoutwednesday-week-32.html\">here<\/a>) from <a href=\"https:\/\/twitter.com\/EmmaWhyte\">@EmmaWhyte<\/a>\u00a0involved continuous dates. Per usual I figured this to be an easy solve, one that I nearly wanted to give up on, and then all at once the light bulb goes off and we&#8217;re rolling. Here&#8217;s my solution and the necessary solves.<\/p>\n<p>The tricky bit with continuous dates is that, by their very nature, they move along a continuous line, but the example workbook has them stacked as discrete date parts would be. First thought here, and Year([Order Date]) to color and we&#8217;re off. Good start, next add Month([Order Date]) to Columns, switch to Discrete&#8230; and fail. Because I&#8217;ve got a Discrete Date part on color, it&#8217;s segmenting into 4 parts, not stacking. To the drawing board&#8230;<\/p>\n<p>The solve here was to create a custom date whereby we &#8216;trick&#8217; Tableau into putting all into the same year, and because we have the Year on color, it segments into 4 lines. Here&#8217;s my custom date (you could pick any year):<\/p>\n<pre>DATE(\"1900-\"+STR(MONTH([Order Date]))+\"-\"+STR(DAY([Order Date])))<\/pre>\n<p>The remaining work was rather straighforward (so I found at least), you&#8217;ll have to add back the year for the tooltip in a separate calculation, which I did like this:<\/p>\n<p>DATE(STR(YEAR([Order Date]))+&#8221;-&#8220;+STR(MONTH([Order Date]))+&#8221;-&#8220;+STR(DAY([Order Date])))<\/p>\n<p>I may have &#8216;cheated&#8217; as I put my title into a separate sheet and combined in the dashboard, whereas Emma had the title in the same sheet. I find this to be the beauty of the product and challenges is, as with programming, there isn&#8217;t one &#8216;right&#8217; solution &#8211; but there may be better\/worse ways of arriving at the end goal.<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/public.tableau.com\/views\/WorkoutWednesday2017Week32\/Dashboard1?:showVizHome=no&amp;:device=tablet&amp;:embed=true&amp;:toolbar=no&amp;:tabs=no\" width=\"600\" height=\"985\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week&#8217;s #WorkoutWednesday challenge (available here) from @EmmaWhyte\u00a0involved continuous dates. Per usual I figured this&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[4],"tags":[15,19],"class_list":["post-230","post","type-post","status-publish","format-standard","hentry","category-viz","tag-tableau","tag-workout-wednesday"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/posts\/230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/comments?post=230"}],"version-history":[{"count":0,"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/posts\/230\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/media?parent=230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/categories?post=230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.a-j-c.com\/welcome\/wp-json\/wp\/v2\/tags?post=230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}