Skip to main content

weekday - script and chart function

This function returns a dual value with:

  • A day name as defined in the environment variable DayNames.
  • An integer between 0-6 corresponding to the nominal day of the week (0-6).


weekday(date [,first_week_day=0])

Return data type: dual


Weekday arguments
Argument Description
date The date to evaluate.

If you don't specify first_week_day, the value of variable FirstWeekDay will be used as the first day of the week.

If you want to use another day as the first day of the week, set first_week_day to:

  • 0 for Monday
  • 1 for Tuesday
  • 2 for Wednesday
  • 3 for Thursday
  • 4 for Friday
  • 5 for Saturday
  • 6 for Sunday

The integer returned by the function will now use the first day of the week that you set with first_week_day as base (0).

Example 1:  

weekday( '1971-10-12' )

returns 'Tue' and 1

Example 2:  

weekday( '1971-10-12' , 6)

returns 'Tue' and 2.

In this example we use Sunday (6) as the first day of the week.

Example 3:  

weekday( '1971-10-12')

returns 'Tue' and 2.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!

Join the Analytics Modernization Program

Remove banner from view

Modernize without compromising your valuable QlikView apps with the Analytics Modernization Program. Click here for more information or reach out: