Hi,
is it possible to create a date from only year and week information?
I.e. 12th week in 1998 and then pick the date of the first day of the week?
Regards
Solved! Go to Solution.
Hi @UnknownUser, here is a formula that might work for you. This is assuming that the first week of the year is numbered 0. I borrowed from an earlier post by @jgo, which is below. Using my formula, you should be able to plug in your own fields for [Week] and [Year].
DateTimeAdd(DateTimeAdd(DateTimeParse(ToString([Year]), "%Y"),[Week]*7,"days"),-ToNumber(DateTimeFormat(DateTimeAdd(DateTimeParse(ToString([Year]), "%Y"),[Week]*7,"days"),'%w')),'days')
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Week-Start-formula/td-p/44338
I'd create a startofyear date and then use datetimeadd to add 7*weeknumber in days. You can then retrieve the resultant day of week and build some logic to subtract days to get you to the start of the week.
You'll have to decide what to do if the start of year falls on a Sat or Sun.
I've attached an example of @DavidP's suggestion.
Hello Charlie,
I think you should add -7 for Sunday instead of 0. Then the formula will work fine !