---
schema_version: "1"
id: 00f4bd395f079ae10395e0bc5cd977401f2d23dc38072e67809589c587464454
title: Decode the Fact Map
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexcode/apex_analytics_fact_map.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_analytics_fact_map.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 21b8e48d82a306eb480d7d19ccc2c297d6803726dfa10b7bdbf81739f5820cae
description: The fact map contains the summary and record-level data values for a report.
---
# Decode the Fact Map

The fact map contains the summary and record-level data values for a report.

Depending on how you run a report, the fact map in the report results can contain values for only summary or both summary and detailed data. The fact map values are expressed as keys, which you can programmatically use to visualize the report data. Fact map keys provide an index into each section of a fact map, from which you can access summary and detailed data.

The pattern for the fact map keys varies by report format as shown in this table.

<table class="featureTable sort_table" summary="">


          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d97166e57">Report format</th>

              <th class="featureTableHeader  " id="d97166e60">Fact map key pattern</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d97166e57" data-title="Report format">Tabular</td>

              <td class="entry" headers="d97166e60" data-title="Fact map key pattern">
                <p class="p"><var class="keyword varname">T!T</var>: The grand total of a report. Both record data values and the
                  grand total are represented by this key.</p>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d97166e57" data-title="Report format">Summary</td>

              <td class="entry" headers="d97166e60" data-title="Fact map key pattern">
                <p class="p"><var class="keyword varname">&lt;First level row grouping_second level row grouping_third level row
                    grouping&gt;!T</var>: <var class="keyword varname">T</var> refers to the row grand total.</p>

              </td>

            </tr>

            <tr>
              <td class="entry" headers="d97166e57" data-title="Report format">Matrix</td>

              <td class="entry" headers="d97166e60" data-title="Fact map key pattern">
                <p class="p"><var class="keyword varname">&lt;First level row grouping_second level row grouping&gt;!&lt;First level
                    column grouping_second level column grouping&gt;</var>.</p>

              </td>

            </tr>

          </tbody>

        </table>

Each item in a row or column grouping is numbered starting with 0. Here are some examples of fact map keys:

| Fact Map Key | Description |
| --- | --- |
| 0!T | The first item in the first-level grouping. |
| 1!T | The second item in the first-level grouping. |
| 0\_0!T | The first item in the first-level grouping and the first item in the second-level grouping. |
| 0\_1!T | The first item in the first-level grouping and the second item in the second-level grouping. |

Let’s look at examples of how fact map keys represent data as it appears in a Salesforce tabular, summary, or matrix report.

## Tabular Report Fact Map

Here’s an example of an opportunities report in tabular format. Since tabular reports don’t have groupings, all of the record level data and summaries are expressed by the T!T key, which refers to the grand total.

![Tabular Report Fact Map Keys](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/dev_guides/apex/images/analyticsapi_tabularfactmap.png)

## Summary Report Fact Map

This example shows how the values in a summary report are represented in the fact map.

![Summary Report Fact Map Keys](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/dev_guides/apex/images/analyticsapi_summaryfactmap.png)

<table class="featureTable sort_table" summary=""><tbody class="tbody"><tr><td class="entry"><strong class="ph b">Fact Map Key</strong></td><td class="entry"><strong class="ph b">Description</strong></td></tr><tr><td class="entry"><samp class="codeph nolang">0!T</samp></td><td class="entry">Summary for the value of opportunities in the Prospecting stage.</td></tr><tr><td class="entry"><samp class="codeph nolang">1_0!T</samp></td><td class="entry">Summary of the probabilities for the Manufacturing opportunities in the Needs Analysis stage.</td></tr></tbody></table>

## Matrix Report Fact Map

Here’s an example of some fact map keys for data in a matrix opportunities report with a couple of row and column groupings.

![Matrix Fact Map Keys](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/dev_guides/apex/images/analyticsapi_matrixfactmap.png)

| **Fact Map Key** | **Description** |
| --- | --- |
| 0!0 | Total opportunity amount in the Prospecting stage in Q4 2010. |
| 0\_0!0\_0 | Total opportunity amount in the Prospecting stage in the Manufacturing sector in October 2010. |
| 2\_1!1\_1 | Total value of opportunities in the Value Proposition stage in the Technology sector in February 2011. |
| T!T | Grand total summary for the report. |