|
<< Click to Display Table of Contents >> TIMEFILTER |
![]() ![]()
|
The TIMEFILTER statement is used to indicate periods that are to be omitted in output from PRT, MULPRT, DISP, and TABLE. The statements PLOT, SHEET and CLIP are not affected by the filter. Out-filtered periods may be omitted, or their values may be aggregated (as averages).
Note: due to rebuilding of the inner workings of Gekko from version 2.x to 3.x, TIMEFILTER does not at the moment work for other frequencies than annual, and timefilter-averages do not work for any frequencies. In Gekko 3.x, timefilters in for instance PRT are more complicated to implement than in Gekko 2.x, because PRT supports printing of mixed frequencies, and PRT also supports auto-collapsing. Bringing back the full TIMEFILTER statement also for non-annual frequencies and for averages could be done if there is sufficient user interest.
timefilter filterperiods ;
filterperiods |
periods, periods, ... (note the comma) |
periods |
singleperiod | periodlist |
singleperiod |
Single observation |
periodlist |
singleperiod .. singleperiod BY step (if you prefer, you may use TO instead of .., and STEP instead of BY) |
step |
An optional stepsize (default step: 1). Must be integer >= 1. Omit BY step if not needed. |
You may define periods like this:
timefilter 2010..2015, 2020..2030 by 5; |
This results in the following:
Chosen periods: 2010, 2011, 2012, 2013, 2014, 2015, 2020, 2025, 2030 |
So when you use for instance PRT, you will get all periods from 2010 up to and including 2015, and then the rest of the periods up to 2030 only shown every 5 years (2020, 2025 and 2030). A normal print will look like this:
prt fY; |
fY % |
whereas an average-print will look like this (averages do not work at the moment, for any frequency):
prt <filter=avg> fY; |
fY % |
Here, the skipped periods are averaged into the shown periods. For the absolute level (the fY column), a simple average is used, whereas for the percentage column, a more complicated averaging of growth rates is performed, in order to yield consistent average growth rates for the aggregated periods
The filter is controlled via these general options:
•option timefilter = no;
•option timefilter type = hide; [hide|avg]
The last options shows whether filtering is to be applied or not, whereas the first options selects the type of filtering. These can be overridden in the PRT statement, for instance prt <filter>, prt <nofilter>, prt <filter=hide>, or prt <filter=avg>, so that different filtering can be performed quite easily in the PRT statement, without having to change the globals options.
TIMEFILTER does not alter the TIME period settings. Note that this statement only affects print layout (so SIM, SERIES etc. are unaffected by TIMEFILTER settings). When simulating for instance, out-filtered periods would never be skipped: filtering only affects visual reporting.
You may use to instead of .. and step instead of by when indicating periods, so 2010..2020 by 2 and 2010 to 2020 step 2 are equvialent (and the latter is more similar to the FOR loop over dates).
option timefilter = no;
option timefilter type = hide;
filteredperiods()