Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Marcio_Campestrini
Specialist
Specialist

Week and WeekName difference

Hi

Today, I've come across an unusual situation: the Week and WeekName functions do not calculate the same week for the same date.

According to the documentation the Week function returns in according to ISO8601, which for today (26/10/17) returns week 43.

The trick situation occurs when I use the WeekName function for the same date, which returns 2017/42.

Márcio Rodrigo Campestrini
Labels (4)
4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

It seems to be a bug. Kindly report to Qlik Support for the same.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anders_Eriksson
Partner - Specialist
Partner - Specialist

Could it be that WeekName returns the week according to your OS settings?

el_aprendiz111
Specialist
Specialist

Hi,

http://help.qlik.com/en-US/sense/September2017/Subsystems/Hub/Content/Scripting/DateAndTimeFunctions...

Example

Result

weekname('12/01/2013')

Returns 2013/02.

weekname('12/01/2013', -1)

Returns 2013/01.

weekname('12/01/2013', 0, 1)

Returns '2013/02.

Example

Result

week( '2012-10-12' )

returns 41.

week( '35648' )

returns 32, because 35648 = 1997-08-06

week('2012-10-12', 0, 1)

returns 42

rbecher
MVP
MVP

Could it be your OS week starts on Sunday?

43 = WeekName(MakeDate(2017,10,26), 0, 0)

42 = WeekName(MakeDate(2017,10,26), 0, 6)

..and your Qlik app week starts on Monday:

Set FirstWeekDay=0;

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine