Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
=week(date#(DT, 'DD/MMM/YYYY:hh:mm:ss'))
=week(date#(DT, 'DD/MMM/YYYY:hh:mm:ss'))
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).