The weekDay function returns the day of the week as an integer for each value of date.
The date, week, month, quarter or datetime attribute if the extract parameter is False to retrieve the weekday value. The date parameter is mandatory.
A binary (True/False) set as True as default, controlling if the numeration of the days starts from Monday (True) or Sunday (False).
The following example uses the Instagram_data dataset.
In this example, we want to fill a new attribute with the weekday when the picture was posted.
We add a new attribute, called weekday, and type the following formula:
and the attribute is filled with the corresponding integer value of the day of the week.
As we didn’t specify the extract parameter, it is set as True, so the first day of the week is Monday.
The results can be read as follows:
and so on.