Metropolis Documentation 4.3 > Applications > Date Set

The Date Set application lets you create Date Set documents, which represent a set of dates. You can use Date Set documents throughout Palantir to focus your analysis on specific dates. For example, the expression GOOG.changeOverDateSet(DateSet("Past 6 Months")) uses the Date Set "Past 6 Months" to calculate the price change in Google over the past 6 months. The Date Set application provides a rich set of tools to select and filter dates.

In addition to full days (i.e. every day for the past 6 months), Date Sets can also contain intraday values such as 2-4pm. This documentation doesn't cover intraday values because it is a very advanced use case. For more information, please contact finance-support@palantir.com.

Getting Started

You create a Date Set document by adding one or more filters to the document. Filters operate in succession on the results of previous filter operations. The Date Set application includes a variety of filters which can be as simple as "selecting June 1 to June 30, 2007" or as complex as selecting "the week after every day in January in which the S&P 500 had a two standard deviation move". Let's start by walking through a simple example.

  1. Open the Date Set app. The Date Set application starts with no filters.
  2. In Periodic Filters, click Order of Month.
  3. In the Filter pane, click last and Thurs. This filter selects the last Thursday of every month.
  4. In Other Filters, click More... and select Last 5 Years. This filter selects the last 5 years relative to the Value On Date, as specified in the Date/Time Controls panel in the ribbon (which defaults to today).
  5. Save the document with the name Last Thursday of Past 5 years.

Your screen should look like this.

This example selects the last Thursday of every month. For example, the expression GOOG.close().sample(DateSet("Last Thursday of Past 5 Years")) calculates Google's closing prices on the last Thursday of every month for the past 5 years.

Basic Reference

The Ribbons contain controls to add various filters. In the Getting Started example, we added two filters which are displayed in the Filter pane. Also, the Value-On Date determines the date on which the system calculates the filters. In this example, the Last 5 Years filter is calculated relative to today.

Home Ribbon

Time Series Filters - select dates based on the trading days of a specified instrument or the dates when a time series meets specified conditions, like crossing over another time series.

    • Time Series Threshold - Selects dates when a time series has values above, below, or in between specified parameters. This filter can also select dates when one time series crosses another, or crosses above or below it. For example, enter GOOG.marketCap() and AAPL.marketCap() to select all the dates when Google's market capitalization was above Apple's. The pink shading highlights the selected dates on the Chart.
    • Valid Dates - Selects the dates when a time series is valid. If you change the Intersect option to Remove, the filter selects the days the time series is not valid (ex. holidays, weekends). For example, enter GOOG in the expression bar to select all days when Google trades.

Periodic Filters - select dates based on a repeating rule, like the "15th of every month." Hold down the control key to select more than one month, day, or day of the week.

    • Recurring - Selects recurring dates based on month of the year, day of the month, or day of the week. For example, the following filter selects the 1st and 15th of July for all the years in the date range.
    • Every Other - Selects days, weeks, months, or years on an alternating schedule. For example, the following filter selects the days in every other month for all the years in the date range.
    • Order of Month - Selects dates based on the order they occur. For example, in the Getting Started example, we set the filter to select the last Thursday in every month.

Other Filters - select dates by explicit ranges, by referring to previously saved Date Sets, or by a specific metric.

    • List of Dates - Selects dates based on a date range. For example, the following filter selects all dates between 4/8/1999 and 4/8/2009 inclusive and excludes all other dates.
    • Other Date Set - Selects dates based on an existing Date Set document.
    • Metric Date Set - Selects dates based on any metric that returns a DateSet.
    • More
      • Relative Filters select a day or a date range relative to the Value-On date, such as today, yesterday, a week ago, a month ago, etc.
        The filters are computed based on the Value-On date of the application where the Date Set is being used. For example, in the Calculator application, the filters are computed based on the Value-On date in Calculator, not the Value-On Date in Date Set.
      • Blank Relative - Selects dates relative to a starting date. For example, the following filter selects the dates between 1 and 3 weeks ago relative to today.
      • Last 5 Years - A version of the Blank Relative filter with its parameters set to select all dates between 5 years ago and today.
      • The remaining filters represent a version of the Blank Relative filter with its parameters set to select a single day, week, month, or year, relative to today.

Date/Time Controls - Set the Value-On Date.

Adjustments Ribbon


Shifting and adjusting dates makes it possible to analyze time series performance before or after specific events. Adjust dates by shifting them forward or backward by a day or a week or extending the range of selected dates. The adjustment controls are located under the Adjustment tab in the ribbon.

  • Static Adjustments
    • Shift Dates - Shifts dates forward or backward by the specified number of days, weeks, months, years, or trading days.
    • Shift One Day - A version of the Shift Dates adjustment with its parameters set to moves all the dates forward by one day.
    • Shift One Week - A version of the Shift Dates adjustment with its parameters set to move all the dates forward by one week.
    • Extend Dates - Expands the start/end of all date ranges by a specified number of days, weeks, months, years, or trading days.
    • Extend One Day - A version of the Extend Dates adjustment with its parameters set to expand the end of all date ranges by 1 day.
    • Extend One Week - A version of the Extend Dates adjustment with its parameters set to expand the end of all date ranges by 1 week.
  • Boundary Adjustments
    • Shift to Boundary - Shifts dates to the next, previous, or closest boundary. A boundary can be the start of a day, week, month, year, or the trading days of a time series.
    • Shift to Next Trading Day - A version of the Shift to Boundary adjustment with its parameters set to shift dates to the next trading day.
    • Shift to Previous Trading Day - A version of the Shift to Boundary adjustment with its parameters set to shift dates to the previous trading day.
    • Extend to Boundary - Expands/Contracts the start or end of all date ranges to the next boundary. A boundary can be the start of a day, week, month, year, or the trading days of a time series.
    • Change Frequency - Changes the frequency

Export Ribbon


Offers options to export the dates as a table or to the clipboard.

Filter Panel


The Filter Panel displays the list of filters in the document. In the Getting Started example, we add two filters. The first filter excludes all dates that are not the last Thursday of each month. The second filter excludes the remaining dates that are not within the last 5 years. Alternatively, you can start with no dates and add the desired days. The filter pane also enables you to change the order of filters, mark filters as active/inactive, and remove filters.

Date Set Panel


The Date Set panel displays the selected dates (dates that pass through the filters) as a Date List, Segment Breakdown, Chart, or Calendar. In the Getting Started example, the panel displays the last Thursday of every month for the past 5 years from today (the default Value-On Date). The buttons in the pane enable you to view the set of dates in a list, in segments, on a chart, or on a calendar.

  • Date List - Displays a list of dates.
  • Segment Breakdown - Displays a list of contiguous date segments.
    You can perform additional analysis in the Segment Breakdown view by entering an instrument in the Add Column expression bar. The column displays its percent change, annualized return, sigma, average historical volatility, average implied volatility, or average value over each date segment. For example, enter AAPL and click Percent Change to view Apple's percent change over each segment.
  • Chart - Displays selected dates on a Chart.
  • Calendar - Highlights selected dates on a calendar.

Concepts and Features

Using Date Sets in Palantir

After you create a Date Set, you can use it in the other Palantir applications. For example:

  • Expression Bar: you can use reference Date Sets in expressions. For example, in Calculator, enter the following:
    YHOO.correlationOverDateSet(DateSet("Past 3 Years"), MSFT)
    GOOG.annualReturn(DateSet("Past 3 Years"))
    AAPL.hvolOverDateSet(DateSet("Past 3 Months"))
    
  • The Histogram Filter in Explorer: enter percentageOverDateSet(DateSet("Past Week")) to plot a histogram of the percentage change over the past week.
  • Sample dates in Regression: use date sets to set the sample dates in Regression.

Examples

First Trading Day of the Month

The following example will show you how to create a DateSet that gives the first trading day of every month.

  1. Open a new DateSet document.
  2. Add a Recurring filter from the Periodic Filters panel.
  3. Under Day of Month , select the first day.
  4. From the Adjustments tab in the ribbon, add a Shift to Boundary adjustment.
  5. Change bounday to time-series point and enter SPX as the boundary time series.
  6. Save this DateSet as "First Trading Date of the Month". We now have a DateSet that gives you the first trading day of every month.

To cover the case where the first of the month falls on a weekend, we can transform our DateSet into one that contains the closest trading day on or before the first of the month (i.e. shifts back the date every time the 1st falls on a weekend).

To do this, change next to previous.

Save this DateSet as "On or Before First Trading Date of the Month". We now have a DateSet that gives you the closest trading day to the first of the month.

Previous Versions

Date Set 4.3

To streamline the Segment Breakdown panel, we have removed the Percent Change, Annualized Return, Sigma, Avg HVol, and Avg Value buttons, as well as the time series code editor.

Date Set 4.1

Document Selectors

You can no longer choose arbitrary DateSet Document selectors. We have removed the Select Date Set button from Date Set's End Date selector; you can now only select from an existing list of options.


Previous documents that chose an arbitrary DateSet in value-on metric selectors (ex. those found in Explorer filters) and in Date Set's end date cropping will no longer open unless they are just a certain number of days, such as Today or 7 days ago.

Date Set 4.0

Intraday Changes

We've enhanced our support for intraday data and as a result, there is now an option in the Recurring filter to sample specific instants, such as the first instant of every hour. This lets you create Date Sets with a finite number of instants instead of entire ranges.

Additionally, there is a new Change Frequency option in the the Adjustments ribbon. This filter converts a daily date set to an intraday date set and vice versa.

For more information on intraday, see Intraday Data 4.0.

Market Time Series Filter Removal

Due to the Branching of Capital Markets this milestone, we have removed the Market Hours Time Series filter from Date Set.

For more information about what is new in the platform, see Version History.

Related Links

Need Help? Email us at           © 2014 Palantir Technologies  ·  Terms of Use  ·  Privacy and Security Statement