{"id":20011,"date":"2020-07-18T00:02:22","date_gmt":"2020-07-18T07:02:22","guid":{"rendered":"https:\/\/edelalon.com\/blog\/?p=20011"},"modified":"2020-07-19T11:09:11","modified_gmt":"2020-07-19T18:09:11","slug":"tableau-datepart","status":"publish","type":"post","link":"https:\/\/www.edelalon.com\/blog\/tableau-datepart\/","title":{"rendered":"Tableau Datepart"},"content":{"rendered":"<p>I had a funky import into Tableau from Excel where my time entry where 1:23 turned into December 31, 1898 0:01:23 AM. For my data, I needed the number of minutes and seconds and was hoping that 1:23 would read as 1 minute and 23 seconds to then convert it to 83 seconds. In order to convert the MM DD, YYYY HH:MM:SS to something I can use, I had to use the DATEPART function in Tableau. This function looks like:<\/p>\n<p><strong>DATEPART(date_part, date)<\/strong><\/p>\n<p>To do so, I created a calculated field to pulled out the number of seconds and wrote the function as:<\/p>\n<p><strong>DATEPART(&#8220;minute&#8221;,[field name])*60+DATEPART(&#8220;second&#8221;,[field name])<\/strong><\/p>\n<p>I did have to calculate the total number of minutes by doing this:<\/p>\n<p><strong>DATEPART(&#8220;minute&#8221;,[field name])+DATEPART(&#8220;second&#8221;,[field name])\/60<\/strong><\/p>\n<p>Doing this changed the result to 1.38333333333.<\/p>\n<p>Returns\u00a0<code>date_part<\/code>\u00a0of\u00a0<code>date<\/code>\u00a0as an integer.<\/p>\n<p>Thanks for reading. Send me a note if you want to see more Tableau stuff.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had a funky import into Tableau from Excel where my time entry where 1:23 turned into December 31, 1898 0:01:23 AM. For my data, I needed the number of minutes and seconds and was hoping that 1:23 would read as 1 minute and 23 seconds to then convert it to 83 seconds. In order [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":20012,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"tdm_status":"","tdm_grid_status":"","footnotes":""},"categories":[8],"tags":[1112],"class_list":["post-20011","post","type-post","status-publish","format-standard","has-post-thumbnail","category-tools","tag-tableau"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Tableau Datepart &#8226; Edel Alon<\/title>\n<meta name=\"description\" content=\"Hello, we have well thought out reading topics on technology, leadership, project management, food, weddings, and tools to help your daily life. Need some Excel tips or wedding planning advice? Read now and don&#039;t forget to comment.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.edelalon.com\/blog\/tableau-datepart\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tableau Datepart &#8226; Edel Alon\" \/>\n<meta property=\"og:description\" content=\"Hello, we have well thought out reading topics on technology, leadership, project management, food, weddings, and tools to help your daily life. Need some Excel tips or wedding planning advice? Read now and don&#039;t forget to comment.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.edelalon.com\/blog\/tableau-datepart\/\" \/>\n<meta property=\"og:site_name\" content=\"Edel Alon\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-18T07:02:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-07-19T18:09:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.edelalon.com\/blog\/wp-content\/uploads\/2020\/07\/tableau.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"654\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Edel Alon\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Edel Alon\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/tableau-datepart\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/tableau-datepart\\\/\"},\"author\":{\"name\":\"Edel Alon\",\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/#\\\/schema\\\/person\\\/aaf86bfa75efb59a5f0855c63e330e42\"},\"headline\":\"Tableau Datepart\",\"datePublished\":\"2020-07-18T07:02:22+00:00\",\"dateModified\":\"2020-07-19T18:09:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/tableau-datepart\\\/\"},\"wordCount\":155,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/#\\\/schema\\\/person\\\/aaf86bfa75efb59a5f0855c63e330e42\"},\"image\":{\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/tableau-datepart\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/tableau.jpg\",\"keywords\":[\"tableau\"],\"articleSection\":[\"Tools\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/tableau-datepart\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/tableau-datepart\\\/\",\"url\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/tableau-datepart\\\/\",\"name\":\"Tableau Datepart &#8226; Edel Alon\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/tableau-datepart\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/tableau-datepart\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/tableau.jpg\",\"datePublished\":\"2020-07-18T07:02:22+00:00\",\"dateModified\":\"2020-07-19T18:09:11+00:00\",\"description\":\"Hello, we have well thought out reading topics on technology, leadership, project management, food, weddings, and tools to help your daily life. Need some Excel tips or wedding planning advice? Read now and don't forget to comment.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/tableau-datepart\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/tableau-datepart\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/tableau-datepart\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/tableau.jpg\",\"contentUrl\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/07\\\/tableau.jpg\",\"width\":1200,\"height\":654},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/tableau-datepart\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tableau Datepart\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/\",\"name\":\"Edel Alon\",\"description\":\"Projects, Tools, Craft, Food, Music, and Other Stuff\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/#\\\/schema\\\/person\\\/aaf86bfa75efb59a5f0855c63e330e42\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/#\\\/schema\\\/person\\\/aaf86bfa75efb59a5f0855c63e330e42\",\"name\":\"Edel Alon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/09\\\/edel-alon-logobl.png\",\"url\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/09\\\/edel-alon-logobl.png\",\"contentUrl\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/09\\\/edel-alon-logobl.png\",\"width\":136,\"height\":80,\"caption\":\"Edel Alon\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/09\\\/edel-alon-logobl.png\"},\"description\":\"Edel-Ryan Alon is a starving musician, failed artist, connoisseur of fine foods, aspiring entrepreneur, husband, father of two, geek by day, cook by night, and an all around great guy.\",\"sameAs\":[\"https:\\\/\\\/edelalon.com\"],\"url\":\"https:\\\/\\\/www.edelalon.com\\\/blog\\\/author\\\/edelalon\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Tableau Datepart &#8226; Edel Alon","description":"Hello, we have well thought out reading topics on technology, leadership, project management, food, weddings, and tools to help your daily life. Need some Excel tips or wedding planning advice? Read now and don't forget to comment.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.edelalon.com\/blog\/tableau-datepart\/","og_locale":"en_US","og_type":"article","og_title":"Tableau Datepart &#8226; Edel Alon","og_description":"Hello, we have well thought out reading topics on technology, leadership, project management, food, weddings, and tools to help your daily life. Need some Excel tips or wedding planning advice? Read now and don't forget to comment.","og_url":"https:\/\/www.edelalon.com\/blog\/tableau-datepart\/","og_site_name":"Edel Alon","article_published_time":"2020-07-18T07:02:22+00:00","article_modified_time":"2020-07-19T18:09:11+00:00","og_image":[{"width":1200,"height":654,"url":"https:\/\/www.edelalon.com\/blog\/wp-content\/uploads\/2020\/07\/tableau.jpg","type":"image\/jpeg"}],"author":"Edel Alon","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Edel Alon","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.edelalon.com\/blog\/tableau-datepart\/#article","isPartOf":{"@id":"https:\/\/www.edelalon.com\/blog\/tableau-datepart\/"},"author":{"name":"Edel Alon","@id":"https:\/\/www.edelalon.com\/blog\/#\/schema\/person\/aaf86bfa75efb59a5f0855c63e330e42"},"headline":"Tableau Datepart","datePublished":"2020-07-18T07:02:22+00:00","dateModified":"2020-07-19T18:09:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.edelalon.com\/blog\/tableau-datepart\/"},"wordCount":155,"commentCount":0,"publisher":{"@id":"https:\/\/www.edelalon.com\/blog\/#\/schema\/person\/aaf86bfa75efb59a5f0855c63e330e42"},"image":{"@id":"https:\/\/www.edelalon.com\/blog\/tableau-datepart\/#primaryimage"},"thumbnailUrl":"https:\/\/www.edelalon.com\/blog\/wp-content\/uploads\/2020\/07\/tableau.jpg","keywords":["tableau"],"articleSection":["Tools"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.edelalon.com\/blog\/tableau-datepart\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.edelalon.com\/blog\/tableau-datepart\/","url":"https:\/\/www.edelalon.com\/blog\/tableau-datepart\/","name":"Tableau Datepart &#8226; Edel Alon","isPartOf":{"@id":"https:\/\/www.edelalon.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.edelalon.com\/blog\/tableau-datepart\/#primaryimage"},"image":{"@id":"https:\/\/www.edelalon.com\/blog\/tableau-datepart\/#primaryimage"},"thumbnailUrl":"https:\/\/www.edelalon.com\/blog\/wp-content\/uploads\/2020\/07\/tableau.jpg","datePublished":"2020-07-18T07:02:22+00:00","dateModified":"2020-07-19T18:09:11+00:00","description":"Hello, we have well thought out reading topics on technology, leadership, project management, food, weddings, and tools to help your daily life. Need some Excel tips or wedding planning advice? Read now and don't forget to comment.","breadcrumb":{"@id":"https:\/\/www.edelalon.com\/blog\/tableau-datepart\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.edelalon.com\/blog\/tableau-datepart\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.edelalon.com\/blog\/tableau-datepart\/#primaryimage","url":"https:\/\/www.edelalon.com\/blog\/wp-content\/uploads\/2020\/07\/tableau.jpg","contentUrl":"https:\/\/www.edelalon.com\/blog\/wp-content\/uploads\/2020\/07\/tableau.jpg","width":1200,"height":654},{"@type":"BreadcrumbList","@id":"https:\/\/www.edelalon.com\/blog\/tableau-datepart\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.edelalon.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Tableau Datepart"}]},{"@type":"WebSite","@id":"https:\/\/www.edelalon.com\/blog\/#website","url":"https:\/\/www.edelalon.com\/blog\/","name":"Edel Alon","description":"Projects, Tools, Craft, Food, Music, and Other Stuff","publisher":{"@id":"https:\/\/www.edelalon.com\/blog\/#\/schema\/person\/aaf86bfa75efb59a5f0855c63e330e42"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.edelalon.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.edelalon.com\/blog\/#\/schema\/person\/aaf86bfa75efb59a5f0855c63e330e42","name":"Edel Alon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.edelalon.com\/blog\/wp-content\/uploads\/2017\/09\/edel-alon-logobl.png","url":"https:\/\/www.edelalon.com\/blog\/wp-content\/uploads\/2017\/09\/edel-alon-logobl.png","contentUrl":"https:\/\/www.edelalon.com\/blog\/wp-content\/uploads\/2017\/09\/edel-alon-logobl.png","width":136,"height":80,"caption":"Edel Alon"},"logo":{"@id":"https:\/\/www.edelalon.com\/blog\/wp-content\/uploads\/2017\/09\/edel-alon-logobl.png"},"description":"Edel-Ryan Alon is a starving musician, failed artist, connoisseur of fine foods, aspiring entrepreneur, husband, father of two, geek by day, cook by night, and an all around great guy.","sameAs":["https:\/\/edelalon.com"],"url":"https:\/\/www.edelalon.com\/blog\/author\/edelalon\/"}]}},"_links":{"self":[{"href":"https:\/\/www.edelalon.com\/blog\/wp-json\/wp\/v2\/posts\/20011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.edelalon.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.edelalon.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.edelalon.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.edelalon.com\/blog\/wp-json\/wp\/v2\/comments?post=20011"}],"version-history":[{"count":0,"href":"https:\/\/www.edelalon.com\/blog\/wp-json\/wp\/v2\/posts\/20011\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.edelalon.com\/blog\/wp-json\/wp\/v2\/media\/20012"}],"wp:attachment":[{"href":"https:\/\/www.edelalon.com\/blog\/wp-json\/wp\/v2\/media?parent=20011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.edelalon.com\/blog\/wp-json\/wp\/v2\/categories?post=20011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.edelalon.com\/blog\/wp-json\/wp\/v2\/tags?post=20011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}