Date Quarter Selector Task
The date quarter selector task displays an Options tab containing a combo box. The choices in the combobox are:
- Select quarter - a quarter combobox and year input field are shown
- Current quarter
- Previous quarter
- Next quarter
- Current quarter of previous year
- Current quarter of next year
- N quarters ago - an input field prompts for an integer
- N quarters from now - an input field prompts for an integer
When a selection made and values are specified in any dependent controls the following macro variables are created and set as follows:
- quarter - the first day of the quarter selected or a function that calculates the first day of the quarter of the selection, formatted as DDMMMYYYY
- quarter_end - the last of the quarter selected or a function that calculates the last day of the quarter of the selection, formatted as DDMMMYYYY
- quarter_rel - a code that represents the selection made
- quarter_label - the common name of the selection
An example of the code generated by this task when "Next Quarter" is selected:
%global quarter;
%global quarter_end;
%global quarter_rel;
%global quarter_label;
%let quarter = %sysfunc(intnx(Quarter, %sysfunc(date()), 1, b), DATE9.);
%let quarter_end = %sysfunc(intnx(Quarter, %sysfunc(date()), 1, e), DATE9.);
%let quarter_label = Next Quarter;
%let quarter_rel = Q1Q;
%put _GLOBAL_;
The macro variable values set by this example code, if the current quarter is the first quarter of 2017, are:
GLOBAL QUARTER 01APR2017
GLOBAL QUARTER_END 30JUN2017
GLOBAL QUARTER_LABEL Next Quarter
GLOBAL QUARTER_REL Q1Q