Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
tom2qlik
Contributor

Creating a YearWeek from today

Hi All,

I am attempting to create a date in the format of 'YYYYWW' from today's date.

I had originally "Year(Date(Today()))&Week(Date(Today()))-35)" which produced 201852 meaning the week is correct but the year is not. My aim was for the date to show as 201752, but quickly realised the above code won't be accurate as I would need to hardcode values on the year and on the week.

Basically I'm looking for help to get the year and week for 5 weeks ago which will be 201752 today and in two weeks time be 201802.

Thanks,

Tom

1 Solution

Accepted Solutions

Re: Creating a YearWeek from today

May be this

=Year(Today()-35)&Week(Today()-35)

View solution in original post

2 Replies

Re: Creating a YearWeek from today

May be this

=Year(Today()-35)&Week(Today()-35)

View solution in original post

tom2qlik
Contributor

Re: Creating a YearWeek from today

Of course!  Thank you.