Timeperiod table

A Timeperiod is a pre-configured period of time of interest to the user.

Examples could be "Past 12 Months", "Year to Date", "Calendar Year 2009" or "Fiscal Year 2008".

Different businesses use different time periods as basis for their reporting, and thus applications built on MQL should use these client-specific time periods instead of generic ones.

A time period can be referred to directly in a survey query through its ID, see Filtering. This filters the data set down to the date range specified by the time period.

It is possible to obtain the start and end dates of the time periods through MQL. This is primarily intended for displaying information to the user, as the preferred way of performing the filtering is through referring to the ID.

Table description

DESCRIBE TABLE timeperiod
 key        | name       | encoding |
 id         | Id         | TEXT     |
 name       | Name       | TEXT     |
 short_name | Short name | TEXT     |
 kind       | Kind       | TEXT     |
 startdate  | Start date | DATE     |
 enddate    | End date   | DATE     |
 priority   | Priority   | INTEGER  |
 benchmark  | Benchmark  | TEXT     |

Sample query

SELECT id, name, short_name, kind, startdate, enddate, priority, benchmark FROM timeperiod

Result

 id  | name                          | short_name                    | kind      | startdate  | enddate    | priority | benchmark |
 625 | Calendar Year 2006            | Calendar Year 2006            | NORMAL    | 2006-01-01 | 2007-01-01 | 50       |           |
 568 | Past 12 Months                | Past 12 Months                | NORMAL    | 2009-08-01 | 2010-07-31 | 100      |           |
 569 | Year To Date '10              | Year To Date '10              | NORMAL    | 2010-01-01 | 2010-07-31 | 150      |           |
 570 | Past 6 Months                 | Past 6 Months                 | NORMAL    | 2006-07-01 | 2007-01-01 | 310      |           |
 571 | Past 3 Months                 | Past 3 Months                 | NORMAL    | 2006-10-01 | 2007-01-01 | 320      |           |
 572 | Current Month                 | Current Month                 | NORMAL    | 2010-07-01 | 2010-08-01 | 400      |           |
 573 | Previous Month                | Previous Month                | NORMAL    | 2010-06-01 | 2010-07-01 | 500      |           |
 574 | Past 8 Quarters               | Past 8 Quarters               | NORMAL    | 2008-10-01 | 2010-10-01 | 600      |           |
 575 | Current Quarter               | Current Quarter               | NORMAL    | 2010-07-01 | 2010-10-01 | 700      |           |
 576 | Apr-Jun Quarter '10           | Apr-Jun Quarter '10           | NORMAL    | 2010-04-01 | 2010-07-01 | 800      |           |
 577 | Jan-Mar Quarter '10           | Jan-Mar Quarter '10           | NORMAL    | 2010-01-01 | 2010-04-01 | 900      |           |
 578 | Oct-Dec Quarter '09           | Oct-Dec Quarter '09           | NORMAL    | 2009-10-01 | 2010-01-01 | 1000     |           |
 579 | Jul-Sep Quarter '09           | Jul-Sep Quarter '09           | NORMAL    | 2009-07-01 | 2009-10-01 | 1100     |           |
 580 | Past 12 Months Ending 7/30/10 | Past 12 Months Ending 7/30/10 | BENCHMARK | 2009-08-01 | 2010-07-31 | 10000    |           |
 629 | December 2006                 | December 2006                 | NORMAL    | 2006-12-15 | 2007-01-01 | 10500    |           |
 581 | Calendar Year '2009           | Calendar Year '2009           | BENCHMARK | 2009-01-01 | 2010-01-01 | 11000    |           |
 582 | Calendar Year '2008           | Calendar Year '2008           | BENCHMARK | 2008-01-01 | 2009-01-01 | 12000    |           |
 628 | Yr 2005-2006                  | Yr 2005-2006                  | NORMAL    | 2005-01-01 | 2007-01-01 | 13000    |           |
 627 | Change from 1 year ago        | Change from 1 year ago        | BENCHMARK | 2008-07-31 | 2009-07-31 | 14000    |           |
 622 | NPS Past 90d                  | NPS Past 90d                  | NORMAL    | 2006-10-01 | 2007-01-01 | 40000    |           |
 623 | Change from 91-180 days ago   | Change from 91-180 days ago   | NORMAL    | 2006-07-01 | 2006-10-01 | 40001    |           |
 624 | Change from 91-180 days ago   | Change from 91-180 days ago   | BENCHMARK | 2006-07-01 | 2006-10-01 | 41000    |           |