Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Question on few Environment Variables

What is the use of below variables? In which business scenario we use those?

SET FirstWeekDay=6;

SET BrokenWeeks=1;

SET ReferenceDay=0;

Thanks in advance for your help.

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Hi,

FirstWeekDay

This integer defines which day to use as the first day of the week.

Syntax:

FirstWeekDay

By default, QlikView functions use Monday as the first day of the week. The following values can be used:

  • 0 (= Monday)
  • 1 (= Tuesday)
  • 2 (= Wednesday)
  • 3 (= Thursday)
  • 4 (= Friday)
  • 5 (= Saturday)
  • 6 (= Sunday)

Examples:

Set FirstWeekDay=6; //(set Sunday as the first day of the week)

BrokenWeeks

The setting defines if weeks are broken or not.

Syntax:

BrokenWeeks

By default, QlikView functions use unbroken weeks. This means that:

  • In some years, week 1 starts in December, and in other years, week 52 or 53 continues into January.
  • Week 1 always has at least 4 days in January.

The alternative is to use broken weeks.

  • Week 52 or 53 do not continue into January.
  • Week 1 starts on January 1 and is, in most cases, not a full week.

The following values can be used:

  • 0 (=use unbroken weeks)
  • 1 (= use broken weeks)

Examples:

Set BrokenWeeks=0; //(use unbroken weeks)

Set BrokenWeeks=1; //(use broken weeks)

ReferenceDay

The setting defines which day in January to set as reference day to define week 1.

Syntax:

ReferenceDay

By default, QlikView functions use 4 as the reference day. This means that week 1 must contain January 4, or put differently, that week 1 must always have at least 4 days in January.

The following values can be used to set a different reference day:

  • 1 (= January 1)
  • 2 (= January 2)
  • 3 (= January 3)
  • 4 (= January 4)
  • 5 (= January 5)
  • 6 (= January 6)
  • 7 (= January 7)

Examples:

Set ReferenceDay=3; //(set January 3 as the reference day)

- Anil

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

2 Replies
Chanty4u
MVP
MVP

Hi,

If you want Monday, then you should use

    Set FirstWeekDay = 0; // 0=Mon, 1=Tue, ... , 6=Sun

And if you want Sunday, you should use

    Set FirstWeekDay = 6; // 0=Mon, 1=Tue, ... , 6=Sun



Anil_Babu_Samineni

Hi,

FirstWeekDay

This integer defines which day to use as the first day of the week.

Syntax:

FirstWeekDay

By default, QlikView functions use Monday as the first day of the week. The following values can be used:

  • 0 (= Monday)
  • 1 (= Tuesday)
  • 2 (= Wednesday)
  • 3 (= Thursday)
  • 4 (= Friday)
  • 5 (= Saturday)
  • 6 (= Sunday)

Examples:

Set FirstWeekDay=6; //(set Sunday as the first day of the week)

BrokenWeeks

The setting defines if weeks are broken or not.

Syntax:

BrokenWeeks

By default, QlikView functions use unbroken weeks. This means that:

  • In some years, week 1 starts in December, and in other years, week 52 or 53 continues into January.
  • Week 1 always has at least 4 days in January.

The alternative is to use broken weeks.

  • Week 52 or 53 do not continue into January.
  • Week 1 starts on January 1 and is, in most cases, not a full week.

The following values can be used:

  • 0 (=use unbroken weeks)
  • 1 (= use broken weeks)

Examples:

Set BrokenWeeks=0; //(use unbroken weeks)

Set BrokenWeeks=1; //(use broken weeks)

ReferenceDay

The setting defines which day in January to set as reference day to define week 1.

Syntax:

ReferenceDay

By default, QlikView functions use 4 as the reference day. This means that week 1 must contain January 4, or put differently, that week 1 must always have at least 4 days in January.

The following values can be used to set a different reference day:

  • 1 (= January 1)
  • 2 (= January 2)
  • 3 (= January 3)
  • 4 (= January 4)
  • 5 (= January 5)
  • 6 (= January 6)
  • 7 (= January 7)

Examples:

Set ReferenceDay=3; //(set January 3 as the reference day)

- Anil

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful