# @stacking-mode

## Quick Reference

```sql
-- @stacking-mode: percent
```

## valid Values

`String`

* none
* percent

{% hint style="info" %}
Used with @stacks
{% endhint %}

## Full Example

```sql
-- @chart: area
-- @title: Stacking-mode - 100% normalizing a stacked chart
-- @groups: Month, Channel
-- @subtitle: An example area chart that is 100% stacked
-- @formats: currency
-- @series: Sales
-- @stacks: Channel
-- @stacking-mode: percent
SELECT 
	TRUNC(date_closed, 'MONTH') as Month,
    Channel,
	sum(amount) as Sales
FROM sales
GROUP BY TRUNC(date_closed, 'MONTH'), Channel
ORDER BY TRUNC(date_closed, 'MONTH') ASC;
```

<figure><img src="https://4045370218-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB0xzzR5x0BnQ6kHixlzd%2Fuploads%2FpCMkyzIpQ2UXpsrZ2lpP%2Fimage.png?alt=media&#x26;token=fabc46ca-2330-46a5-8972-627ef7c3c254" alt=""><figcaption><p>Example of stacking-mode: percent </p></figcaption></figure>

| MONTH                            | CHANNEL  | SALES     |
| -------------------------------- | -------- | --------- |
| January, 01 2017 00:00:00 +0000  | coldcall | 174647.0  |
| January, 01 2017 00:00:00 +0000  | referral | 1310064.0 |
| January, 01 2017 00:00:00 +0000  | search   | 681444.0  |
| January, 01 2017 00:00:00 +0000  | event    | 502700.0  |
| February, 01 2017 00:00:00 +0000 | pr\_ad   | 509564.0  |
| February, 01 2017 00:00:00 +0000 | search   | 1109141.0 |
| February, 01 2017 00:00:00 +0000 | event    | 417651.0  |
| February, 01 2017 00:00:00 +0000 | referral | 1149197.0 |

## Use Cases

Use `@stacking-mode: percent` when you want to show the relative contribution to the whole stack of the items in the stack. Use `@stacking-mode: none` if you want to reset the stacking-mode&#x20;
