Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date dd/mmm/yyyy hh:mm:ss to week

I have a date field is DD/MMM/YYYY hh:mm:ss





01/Jan/2010:00:01:51

23/Mar/2008:00:08:17



I would like to calculate to week for that date.

Advance thanks for your help





1 Solution

Accepted Solutions
disqr_rm
Partner - Specialist III
Partner - Specialist III

=week(date#(DT, 'DD/MMM/YYYY:hh:mm:ss'))

View solution in original post

2 Replies
disqr_rm
Partner - Specialist III
Partner - Specialist III

=week(date#(DT, 'DD/MMM/YYYY:hh:mm:ss'))

johnw
Champion III
Champion III

Are you asking about a week number? The QlikView week() function appears to implement the ISO 8601 standard for week numbers. According to this standard, weeks start on Monday, and the first week of the year includes January 4. My understanding is that this is the standard in most of Europe.

It's not the standard everywhere, though. If you need some other form of week number, I give some alternatives in this thread:

http://community.qlik.com/forums/p/20615/89794.aspx#89794

Me, I've successfully avoided using week numbers in my applications. I typically will show the start DATE for the week. Since our weeks start on Sunday instead of Monday (I'm in the United States), that's handled with a parameter in the weekstart() function. Specifically, weekstart(MyDate,0,-1). Where I have more room, I'll sometimes specify a date range instead of just week start date, which then also requires weekend(MyDate,0,-1).