Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

zagzebski
Contributor

Change a date to 1st day of year

This seems like it should be simple but couldn't find the exact documentation for it.

I need to change a date so it becomes January 1st of the same year:  12/1/2013 becomes 01/01/2013, 05/05/2012 becomes 01/01/2012, 10/15/2011 becomes 01/01/2011 etc.


Tags (1)
1 Solution

Accepted Solutions
jonasheisterkam
Contributor III

Re: Change a date to 1st day of year

=date(floor(yearstart(DATE)))

yearstart= first ms of the year

floor=will round it

date=makes the integer to date

or =date('1/1/'&year(Date))

3 Replies
jonasheisterkam
Contributor III

Re: Change a date to 1st day of year

=date(floor(yearstart(DATE)))

yearstart= first ms of the year

floor=will round it

date=makes the integer to date

or =date('1/1/'&year(Date))

Employee
Employee

Re: Change a date to 1st day of year

Yearstart function

zagzebski
Contributor

Re: Change a date to 1st day of year


Thanks - don't know how I missed that!

Community Browser