How to set Monday as the first day of week

Four Stars

How to set Monday as the first day of week

I have a problem when I would like to get week of year by the following expression:

TalendDate.formatDate("w", date)

For example, If date = 2019-01-06 it will return 2 which I would like it to return 1.

Forteen Stars

Re: How to set Monday as the first day of week

@fararen , you have write expression the below way.

 

TalendDate.formatDate("w", date))-1

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Four Stars

Re: How to set Monday as the first day of week

It's not working for the other day

Forteen Stars

Re: How to set Monday as the first day of week

@fararen ,what is other day? can you give example.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Four Stars

Re: How to set Monday as the first day of week

For 2019-01-07 it will return 1 which should return 2

Forteen Stars

Re: How to set Monday as the first day of week

@fararen ,check the below one is working as expected.

 

Sting date type

TalendDate.getPartOfDate("DAY_OF_WEEK",TalendDate.parseDate("yyyy-MM-dd", "2019-01-06"))

Date data type

TalendDate.getPartOfDate("DAY_OF_WEEK",row3.date)

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Four Stars

Re: How to set Monday as the first day of week

I would like to get week of year not day of week

Forteen Stars

Re: How to set Monday as the first day of week

@fararen ,did you verify the below link,if not please check.

 

https://community.talend.com/t5/Design-and-Development/resolved-How-to-display-week-number/td-p/6258...

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog