A FactList object is a chronological list of Fact objects that contain the values and breakdowns for a single metric or KPI. The FactList objects passed to a KPI calculation are configured in the KPIs parameters:

By default FactLists for metrics contain data for the date of the KPI calculation and FactLists for KPIs contain data for the previous 30 days. Both of these defaults can be changed by overriding the configuration options kpi_start and metric_start in the KPIs constants.

The above example sets the KPI FactList date range from the start of the week until the date of the KPI calculation and the metric FactList date range is for 3 days up until the date of the KPI calculation. 

The default values for configuration options for kpi_start and metric_start are -30d and START_OF_DAY respectively and the default end date of the range is always the date and time of the KPI calculation.  The end date of of ranges can also be overridden using the configuration options: kpi_end and metric_end

The following is a list of all the support date keywords that can be used to define the start and end date ranges for metric and KPI fact lists.

END_OF_DAY
END_OF_LAST_MONTH
END_OF_LAST_WEEK
END_OF_LAST_YEAR
END_OF_MONTH
END_OF_NEXT_MONTH
END_OF_NEXT_WEEK
END_OF_NEXT_YEAR
END_OF_WEEK
END_OF_YEAR
LAST_MONTH
LAST_WEEK
LAST_YEAR
NEXT_MONTH
NEXT_WEEK
NEXT_YEAR
NOW
DATE
START_OF_DAY
START_OF_LAST_MONTH
START_OF_LAST_WEEK
START_OF_LAST_YEAR
START_OF_MONTH
START_OF_NEXT_MONTH
START_OF_NEXT_WEEK
START_OF_NEXT_YEAR
START_OF_WEEK
START_OF_YEAR
TODAY
TOMORROW
YESTERDAY


All of the above date keywords can be extended with offsets - days, weeks months or years - to provide even greater control over the metric and KPI FactLists. For example,

NOW(-1d)              //equivalent to YESTERDAY
START_OF_MONTH(-1d)   //end of last month
START_OF_MONTH(-6M)   //6 months ago at the start of the month
START_OF_WEEK(-4w)    //4 weeks ago at the start of the week
END_OF_WEEK(-1w)      //end of last week
END_OF_MONTH(-1M)     //end of last month
END_OF_MONTH(-3M)     //go back 3 months at end of that month
START_OF_YEAR(-1y)    //start of last year

Did this answer your question?