select_month_level {when}R Documentation

Configure month level

Description

When the dimension is defined as a date type, using this function we can select the month level and its attributes to include in it. We can also obtain the combination of the year with the month number.

Usage

select_month_level(
  td,
  include_all,
  exclude_all,
  month,
  year_month,
  month_name,
  month_num_name,
  month_abbr,
  month_num_abbr
)

## S3 method for class 'when'
select_month_level(
  td,
  include_all = FALSE,
  exclude_all = FALSE,
  month = NULL,
  year_month = NULL,
  month_name = NULL,
  month_num_name = NULL,
  month_abbr = NULL,
  month_num_abbr = NULL
)

Arguments

td

A when object.

include_all

A boolean, include all fields of the level.

exclude_all

A boolean, exclude all fields of the level.

month

A boolean, include the month number.

year_month

A boolean, include the year-month combination.

month_name

A boolean, include the month name.

month_num_name

A boolean, include the month number and name.

month_abbr

A boolean, include the month name abbreviated version.

month_num_abbr

A boolean, include the month number and name abbreviated version.

Details

For the month we have the month number in the year, its name and the abbreviation of the name. So that the order of the names corresponds to the alphabetical order, the combination of month number and name and/or abbreviation is included.

The include_all and exclude_all parameters allow us to include or exclude all attributes, and then specifically exclude or include the ones we need.

Value

A when object.

See Also

Other dimension definition: define_characteristics(), define_instances(), get_attribute_definition_function(), get_day_part(), get_week_date_range(), select_date_levels(), select_day_level(), select_quarter_level(), select_semester_level(), select_time_level(), select_week_level(), select_year_level(), set_attribute_definition_function(), set_day_part(), when()

Examples


td <- when() |>
  select_month_level(month_abbr = FALSE,
                      month_num_abbr = FALSE)


[Package when version 1.0.0 Index]