cancel
Showing results for 
Search instead for 
Did you mean: 

calculate first day of week in date Format

Venkat
Rocketeer

Hi ,

I have 'Year' column, 'Week Number' with respect to the year, 'Day' number column(i.e. 0 for Sunday,1 for Monday,2 for Tuesday,..6 for Saturday).I need date format using these 3 columns.
Any help on the date column achieving using Year, week Number. Actually I need functionality of same like WEEK_GET_FIRST_DAY FM in SAP i.e. weeks first days date (Sundays date).

 

Thanks

Venkat

2 REPLIES 2

Venkat
Rocketeer

Hi,

 

I have followed the below steps.
 
i)First, I converted the year column to the starting date of the year using the following Date formula:
date(
concat(
string(<Year Column>),'-01-01'
)
)
 
ii)Next, I used the addDays formula to get the derived Date column by multiplying the Week with 7:
 
addDays(<Above Derived Date column>,double(<Week Number>) * 7)
 
 
iii)Finally, using the WeekStartDate formula, I got the Week Start Date with the derived Date Column:
weekStartDate(addDays(<Above Derived Date column>,double(<Week Number>) * 7))
 
Thanks
Venkat

dylanwan
Employee
Employee

Thanks for sharing.  I guess that you have resolved your issue.