Command Reference : Function Reference : Function Reference: D
  
 
@daycount
Number of calendar days in observation.
Syntax: @daycount(d)
d: string, alpha
Return: series
Returns the number of calendar days within each observation of the workfile.
The optional d argument lets you specify an individual day or range of days of the week to count (e.g., “Mon”, “Tues-Thurs”, or “Fri Sat”).
If only one weekday is provided, @daycount returns the number of times that particular weekday occurs within the observation.
If two weekdays are provided, @daycount returns the number of times that any weekday between the two weekdays (inclusive) occurs within the observation.
If the workfile is undated, the function with return NAs.
Examples
series modays = @daycount("Mon")
creates a series with the number of Mondays in each observation.
series wkdays = @daycount(Mon Fri)
fills WKDAYS with the number of weekdays, while
series wenddays = @daycount("Sat Sun")
counts the number of weekend days in each observation.
workfile m 2020 2022
smpl if @daycount("Sat") > 4
creates a monthly workfile, and sets the sample to those months with 5 Saturdays.
Cross-references
See also @weekday.