TIMEFILTER

<< Click to Display Table of Contents >>

Navigation:  Gekko User Manual > Gekko statements >

TIMEFILTER

Previous pageReturn to chapter overviewNext page

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.

 


 

Syntax

 

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.

 

 


 

Examples

 

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
Hidden periods: 2016, 2017, 2018, 2019, 2021, 2022, 2023, 2024, 2026, 2027, 2028, 2029

 

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        % 
  2010   1379471.0000      1.75 
  2011   1431367.5000      3.76 
  2012   1463109.6250      2.22 
  2013   1491416.2500      1.93 
  2014   1512247.3750      1.40 
  2015   1534174.6250      1.45 
  2020   1649068.8750      1.46 
  2025   1773862.6250      1.47 
  2030   1908568.7500      1.48 

 

whereas an average-print will look like this (averages do not work at the moment, for any frequency):

 

prt <filter=avg> fY;

 

                        fY         % 
  2010        1379471.0000      1.75 
  2011        1431367.5000      3.76 
  2012        1463109.6250      2.22 
  2013        1491416.2500      1.93 
  2014        1512247.3750      1.40 
  2015        1534174.6250      1.45 
  2016-2020   1602281.9750      1.45 
  2021-2025   1723167.3250      1.47 
  2026-2030   1853869.9250      1.47 

 

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.

 


 

Note

 

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).

 


 

Related options

 

option timefilter = no;
option timefilter type = hide;

 


 

Related functions

 

filteredperiods()

 


 

Related statements

 

PRT, TIME