DayOfWeekNumber (PQL)
Returns the day of week as a number, between 1-7. By default, it ranges from 1= Sunday till 7=Saturday. Optionally using the “ISO” flag, will range from 1=Monday till 7=Sunday.
- Returned Output: Numeric
- Library: PQL \ Granular \ Date-Time
- Version: 2023.13.000
- Compatibility: Pyramid Query Language (PQL) data sources
Syntax
DayOfWeekNumber( <Column DateTime> , OPTIONAL <Flag> )
* Click on the function's arguments above for more details on the input values.
Comments
- The column needs to be an attribute with date-time values in the model. (The data type needs to be 'date-time.')
- The value returned is based on a natural calendar period.
- For details on how to employ and use this function see the custom column overview.
Different Function types
- This function is similar to the PQL semantic and common functions of the same name. However, it operates on a column directly at the grain.
- As a granular function, it is used in the base SQL query itself.
Examples
This example returns a column with the weekday number (1-7) of each date-time item in the Order Date column:
DayOfWeekNumber([Data].[OrderDate])
You can see the effect from this example snippet in column #3, based on the original date column in position #1: