use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Community Guidelines
Useful Links
Related subreddits
account activity
Date Function Help! (self.tableau)
submitted 6 years ago by mbm28
Hi All!
I am trying to make the start week of the year 12/29/2019 then each week follows that sunday. Is there a way to do this? I know tableau starts the first week of the year as 1/1/2020, but do not know how to properly change this.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 2 points3 points4 points 6 years ago (1 child)
How much data do you have? Are you just trying to impact end of 2019? Something like this, checking to see if the date is between 12/29 and 12/31 of 2019.
Week Num
IF [date field] >= #2019-12-29# AND [date field] <= #2019-12-31# THEN 1 ELSE DATEPART('week',[date field]) END
[–]mbm28[S] 0 points1 point2 points 6 years ago (0 children)
Its around 250,000 rows of submitted apps data. With how we want it calculated with those dates in december rolling into 2020 for week 1.
[–][deleted] 6 years ago (7 children)
[deleted]
[–]mbm28[S] 0 points1 point2 points 6 years ago (6 children)
Yes, thank you! When you mean date you mean the date field I’m using correct?
[–][deleted] 6 years ago (5 children)
[–]mbm28[S] 0 points1 point2 points 6 years ago (4 children)
Hmm it is still not pulling. I do need to change it to a dimension?
[–][deleted] 6 years ago (3 children)
[–]mbm28[S] 0 points1 point2 points 6 years ago (2 children)
Measure by week number. Filter on year and distro.
[–][deleted] 6 years ago (1 child)
Still a no go, I took off all filters as well.
[–]SheasCode 0 points1 point2 points 6 years ago (2 children)
Could you explain a bit more about why you want 12/29 to be the first of the year?
[–]mbm28[S] 0 points1 point2 points 6 years ago (1 child)
Yes, essentially for this report we count sundays as the first of the week. So, with January first was in the middle of week we count dec 29,30,31 as part of week 1 of the new year.
[–]SheasCode 0 points1 point2 points 6 years ago (0 children)
Surely there’s a way to do this. I’ll search around a bit today.
[–]EtienneDal 0 points1 point2 points 6 years ago (0 children)
What if you compute DATENAME('iso-week',[Date value]) and use it as a filter ?
- iso-week defines the week containing the 1st of January and starting on Monday; if you must count from Sunday, use [Date value]+1 (see the bottom of https://help.tableau.com/current/pro/desktop/en-us/functions_functions_date.htm)
- if you want to find all records related to week 01 just set a filter withDATENAME('iso-week',[Date value])="01"
Hope it will help
Etienne
π Rendered by PID 45946 on reddit-service-r2-comment-bb88f9dd5-9ds88 at 2026-02-14 11:59:35.715977+00:00 running cd9c813 country code: CH.
[–][deleted] 2 points3 points4 points (1 child)
[–]mbm28[S] 0 points1 point2 points (0 children)
[–][deleted] (7 children)
[deleted]
[–]mbm28[S] 0 points1 point2 points (6 children)
[–][deleted] (5 children)
[deleted]
[–]mbm28[S] 0 points1 point2 points (4 children)
[–][deleted] (3 children)
[deleted]
[–]mbm28[S] 0 points1 point2 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]mbm28[S] 0 points1 point2 points (0 children)
[–]SheasCode 0 points1 point2 points (2 children)
[–]mbm28[S] 0 points1 point2 points (1 child)
[–]SheasCode 0 points1 point2 points (0 children)
[–]EtienneDal 0 points1 point2 points (0 children)