# Compare data with Matrix mode

Matrix mode plots two dimensions against each other, with one displayed as rows and the other as columns, similar to a pivot table. This layout makes it easier to compare data side-by-side and identify gaps and cross-sell opportunities.

{% embed url="<https://phocassoftware.wistia.com/medias/jqwchyocs1>" %}

{% hint style="success" %}
Watch this Phocas Demo video: [Identify opportunities to grow sales](https://www.phocassoftware.com/watch-demo/identify-opportunities-to-grow-sales?autoplay=true)
{% endhint %}

## Access matrix mode <a href="#comparedatawithmatrixmode-accessmatrixmode" id="comparedatawithmatrixmode-accessmatrixmode"></a>

Although Matrix mode is a [mode](https://docs.phocassoftware.com/analytics/customize-your-view-analytics/change-the-mode), you access it via the **Matrix** button rather than the **Mode** menu, as outlined in the following example.

Suppose you are analyzing your Sales database and want to compare the sales of two complementary products.

1. Select the dimension (**Product Sub Class**), then select the rows\* of the entities you want to matrix (**Downlights** and **Transformers** products).
2. Click the **Matrix** button.
3. Select the other dimension you want to view in the grid (**Customer**).

{% hint style="warning" %}
There is a limit to the number of rows you can matrix. If you try to create a matrix of more than 255 rows, the **Matrix** button will become unavailable (grayed out). When you reduce the number of selected rows, the button becomes active again.
{% endhint %}

## View matrixed data in the grid <a href="#comparedatawithmatrixmode-viewmatrixeddatainthegrid" id="comparedatawithmatrixmode-viewmatrixeddatainthegrid"></a>

Continuing with the example above, you can see in the image below that Matrix mode pivots the data in the grid. The key characteristics of matrix mode are as follows:

* **Matrix** displays in the **Mode** menu and two other modes become available from here, **Matrix Variance** and **Matrix Share**.
* The **Matrix** button turns orange.
* The selected rows in the matrixed dimension (**Product Sub Class**) transform into columns, so they appear across the top of the grid in place of the period columns and on that dimension button, a caret symbol displays along with the number of rows you selected (**^**&#x32;).
* When you select another dimension (**Customer**), the first column in the grid updates to display properties (**Code** and **Name**) for that dimension.
* The measures column remains. In this example it is the **Total Local Value**.

<div align="left"><figure><img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/LYiQRfdCYu6w9u0AwTUo/2940831728.png" alt="" width="544"><figcaption></figcaption></figure></div>

You can review the values in each column to identify comparisons and differences. For example, you might want to look for discrepancies in the sales values of one product compared to the other.

You can change your view of the data to help with your analysis, such as add more properties and measures columns or apply a different time period.

The matrix remains until you remove a dimension filter, reset the data or select another mode. You can select other dimensions and continue your analysis within your existing matrix. If you add more measures, more columns display.

## Customize matrix column headings (matrix captions) <a href="#comparedatawithmatrixmode-customizematrixcolumnheadings-matrixcaptions" id="comparedatawithmatrixmode-customizematrixcolumnheadings-matrixcaptions"></a>

By default, the column headings in matrix mode are made up of the code and first property (which is usually the name) of the selected entities. In the above example, the column headings are **DL/Downlights** and **TR/Transformer**. If you have a dimension without a name property, the first property option uses the first property that appears in your list of dimension properties, giving the column a meaningful heading.

You can customize the headings to display only the code or first property. When the grid is in matrix mode, click the **Options** button, then click **Matrix captions** and select the required option: **Code & First Property**, **Code** or **First Property**.

<div align="left"><figure><img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/KkOV3jXLXRUZZDZO7kbJ/2940929883.png" alt="" width="170"><figcaption></figcaption></figure></div>

If you save your query as a favorite or add it to a dashboard, the new column headings will also be saved.

{% hint style="info" %}
If your administrator has hidden the **Code** property to avoid excessively long headings, you will not see the matrix captions options in the menu.
{% endhint %}

## View a nested matrix <a href="#comparedatawithmatrixmode-viewanestedmatrix" id="comparedatawithmatrixmode-viewanestedmatrix"></a>

A nested grid view displays up to three levels of detail, grouped by dimension. You can use this view with your matrix.

Continuing with the example above, where you create a matrix with the **Product Sub Class** and **Customer** dimensions, suppose you want to view where these customers are located and what industry type they are in.

Create your matrix as usual, click the **Nest** button, then drag the **Region** and **Customer Type** dimensions into the **Levels** box. You can now see two additional levels of detail (region and type) in the grid.

<div align="left"><figure><img src="https://content.gitbook.com/content/itAvDF3MljQXV0rjHRP7/blobs/hAsYgQWLm4oDsfDpEDOn/2940929916.png" alt="" width="544"><figcaption></figcaption></figure></div>

## View another matrix mode <a href="#comparedatawithmatrixmode-viewanothermatrixmode" id="comparedatawithmatrixmode-viewanothermatrixmode"></a>

When you are in matrix mode, two additional modes become available in the **Modes** menu: [Matrix variance mode](https://docs.phocassoftware.com/analytics/customize-your-view-analytics/change-the-mode/matrix-variance-mode) and [Matrix share mode](https://docs.phocassoftware.com/analytics/customize-your-view-analytics/change-the-mode/matrix-share-mode).
