Metropolis Documentation 4.3 > Platform Concepts > The Hedgehog Language

Hedgehog is a programming language that enables users to retrieve and analyze data in Palantir. The language gives you access to models, documents, metrics, mathematical operations, and more. For sophisticated users, Hedgehog also includes features from Java-style languages such as data structures (arrays, lists) and control flow statements (if-else, for, try-catch-finally). These features give you a simple, powerful, and unified way to retrieve, analyze, and present data in Palantir.

Palantir provides a number of places to use the Hedgehog language:

  • Expression bars - indicated by or . Different expression bars accept different types of input. For example, the main expression bar in Chart only accepts time series, date sets, and integers. Expression bars can be found in many applications, including Chart, Explorer, Regression, Details, Spreadsheet, and Calculator, as well as the App Bar at the top of the screen.

  • Metric selectors - indicated by or . Metric selectors are essentially code editors that accept only metrics. Often, you select a metric to categorize or filter a group of items.

  • Custom Metric - In addition to the hundreds of built-in metrics, you can use Hedgehog to create your own metrics in the Custom Metric application. Like built-in metrics, custom metrics are accessible throughout Palantir.

The expression bars and metric selectors only accept single Hedgehog expressions. Think of them like the function bar at the top of an Excel spreadsheet. The code editors in the Custom Metric and Strategy applications accept more complicated Hedgehog code blocks, which often consist of local variables, control statements, and return statements. Think of it like a full programming environment, such as MATLAB or Java.

Getting Started
If you're new to Hedgehog, begin with Introduction to the Hedgehog Language. This document serves as a light-weight introduction to the language and will teach you to write and understand single-line statements.


Types - Types, subtypes, supertypes.
Metric Expressions - Metrics and their use in Hedgehog expressions.
Mathematical Operators - Mathematical operations for numbers, time series, and dates.
Literal Expressions - Strings, numbers, dates, Booleans.
Variables - Definition and use of variables in Hedgehog.
Accessing and Creating Documents Through Code - Constructing documents using Hedgehog.
Control Statements - If statements, For loops, try-catch statements, and ternary operators.
Working with Collections - Different types of collections and important collection-related concepts.
Anonymous Metrics - Introduction to Anonymous Metrics
Casting - Introduction to Casting.

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