# Dynamic Aggregation

{% hint style="info" %}
This guide is for **Tableau** only.
{% endhint %}

We combine the power of Tableau Parameters and visible columns in SuperTables. By doing this we will automatically remove / add detail from the datasheet which results in a different level of aggregation. With this incredible feature you only query the data you are looking at, and Table Calculations / LOD calculations will also keep working like you expect! On top of that you benefit from a performance boost!

#### Dynamic Aggregation V2 (SuperTables 5.5.1+)&#x20;

We have introduced an easier and faster way of setting up dynamic aggregation which only requires 1 parameter! Please find attached workbook for an example:

{% file src="/files/6QkKITxEaQ8Of3UQTQb8" %}

#### Set up Dynamic Aggregation V2

* 1\. Create a string parameter with allowable values on 'All', and select it in the dropdown above. For example: My Parameter
* 2\. Create a calculated field for the dimension you want to auto aggregate. For example: 'My Ship Mode'
* 3\. Use this calculation:\
  IIF(CONTAINS(\[My Parameter], "|My Ship Mode|"), \[Ship Mode], "\_")\
  Optional: Surround the name of the calculation in "|" to ensure unique column selection
* 4\. Remove the original \[Ship Mode] from the datasheet.
* Tip: If you want to reuse your current \[Ship Mode] column configuration, rename \[Ship Mode] to something else (i.e. 'Original Ship Mode') and name you calculated field 'Ship Mode'.

<figure><img src="/files/QybaRG4GTmc85SBaFF4g" alt=""><figcaption></figcaption></figure>

#### Set up Dynamic Aggregation V1 (deprecated)

Enter the configuration screen of SuperTables and head to the **Appearance** tab. Under Layout Options tick ‘Enable auto aggregation based on the visible columns in the table’

<figure><img src="https://appsfortableau.infotopics.com/wp-content/uploads/2022/09/SuperTables-Dynamic-Aggregation.png" alt=""><figcaption></figcaption></figure>

**Our example:**

1\. Create a string parameter with the exact same name as your column. For example: ‘Category’\
2\. Create a calculated field with the same name as the parameter in step 1.\
3\. Use this calculation: IIF(\[parameter\_name] = ‘true’, \[name\_of\_the\_dimension], ‘\_’)\
4\. Check if the parameter updates when you show/hide the column. In this example the column ‘Category’.

Next create a parameter of type ‘string’ with the current value ‘true’ as next we will be creating a calculated field. Follow our GIF to set up the calculated field.

**Parameter:**

<figure><img src="https://appsfortableau.infotopics.com/wp-content/uploads/2022/09/SuperTables-Parameter.gif" alt=""><figcaption></figcaption></figure>

**Calculated Field:**

<figure><img src="https://appsfortableau.infotopics.com/wp-content/uploads/2022/09/SuperTables-Calculated-Field-2.gif" alt=""><figcaption></figcaption></figure>

All done, reload the extension to implement the dynamic aggregation to your SuperTable!

<figure><img src="https://appsfortableau.infotopics.com/wp-content/uploads/2022/09/SuperTables-Dynamic-Aggregation-Front-End.gif" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.infotopics.com/supertables/features/dynamic-aggregation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
