# 13. Context awareness

Inforiver provides built-in context awareness i.e., any comments, notes, data input, or even headers that you add will be updated dynamically based on external filter or slicer selection. You can even select writeback payload with Power BI filters.&#x20;

When users enter comments or manually input data, the visual is unaware of the context, which can be set by a filter or a slicer in the report. In the example, notice how the comment entered for 'APAC' is still visible even after changing the filter to 'EMEA'.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FCXRFASVspwgcJZN8TpO9%2Fimage.png?alt=media&#x26;token=5eccd452-4b9f-4e3d-b072-fed9721dc0c8" alt=""><figcaption><p>Context unaware</p></figcaption></figure>

With Inforiver, you can configure filter context, which ensures that Inforiver visuals are aware of context changes and responsive to changes in filters i.e. the comments, data input, writeback payload, etc are dynamically updated. Let's look at how to set up filter context.

**Step 1**: Click on the **Filter Context** button in the Insert ribbon.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FwPuUCrzwen1Nqq0Y323E%2Fimage.png?alt=media&#x26;token=b88a0c64-fb52-49b4-9caa-e3a471fbbdd1" alt=""><figcaption><p>Filter context navigation</p></figcaption></figure>

**Step 2**: In the popup window, enter the table and field name for which context awareness is being set up. You can enter multiple tables and categories using the Add new link. In this case, we are setting up filter context for Subregions.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FX6IUyUsVIxw3s8WBxfYO%2Fimage.png?alt=media&#x26;token=e2f0f96f-75d3-4b74-b066-c34f74dbad9e" alt=""><figcaption><p>Add table and category</p></figcaption></figure>

**Step 3**: Inforiver automatically generates the DAX code based on the tables and categories entered. Click on the Generate Dax button and copy the DAX.

{% hint style="info" %}
Consider that you have set up filter context for 2 dimensions E.g. Sub Region and Sub Category, the notes/data input/writeback, etc will change when you change these dimensions from an external slicer/filter. Suppose you have a 3rd slicer, E.g. Quarter, that you have not added to the filter context config. Notes/ data input/ writeback, etc will not change when you change the filter selection for quarters.
{% endhint %}

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F5SHjquJV9EYIKSmkXRnU%2Fimage.png?alt=media&#x26;token=a24e7156-a841-4749-a8c1-d9e8d20e9593" alt=""><figcaption><p>Generate DAX</p></figcaption></figure>

**Step 4**: Create a new measure in your data model using the DAX generated in Step 3.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F7Tu5qjFcwW3iMiGRkulS%2Fimage.png?alt=media&#x26;token=c404916d-7938-42f5-a2d2-143d47c83837" alt=""><figcaption><p>Create new measure</p></figcaption></figure>

**Step 5**: Add the new measure to the Others (OM) visual parameter. It gets displayed in the report as well.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FKpG6Hbm5Gw6joB8yfS8I%2Fimage.png?alt=media&#x26;token=042feb65-8981-4051-ad36-cde5866ace05" alt=""><figcaption><p>Add measure to others parameter</p></figcaption></figure>

**Step 6**: Open the filter context configuration from the insert ribbon. You will now be able to select the new FILTERCONTEXT measure from the dropdown. You can enable/disable context awareness for notes and comments using the toggle switches. Click on save.

{% hint style="info" %}
You can add only one filter context measure per visual.
{% endhint %}

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FafQMatwcMITLeKA06NtF%2Fimage.png?alt=media&#x26;token=cf71a619-4b7f-4477-894a-86565cae67b5" alt=""><figcaption><p>Filter context configuration</p></figcaption></figure>

Let's see the context awareness feature in action by adding a notes column and setting a filter on APAC subregions.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FVtxcJJknICE6bMSiLYoa%2Fimage.png?alt=media&#x26;token=8c83827b-9916-485e-a776-b4512bbd5931" alt=""><figcaption><p>Add notes</p></figcaption></figure>

Notice how the note is removed when we change the filter from APAC to EMEA.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FVBufQXBnJUxoJUIpc5Iy%2Fimage.png?alt=media&#x26;token=3b221bad-649a-4319-8653-55e16f11edb8" alt=""><figcaption><p>Filter context in action</p></figcaption></figure>

{% hint style="info" %}
Use the View All Notes option to see the notes entered for particular filter/slicer combinations.
{% endhint %}

### 1. Context awareness in report headers

Slicer selections will be reflected in header presets as well, if your report has been configured for filter context.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FRsgKzapEJrPcf0ghZrup%2F7.1.%20Filter%20context%20header%20preset.png?alt=media&#x26;token=3b62f757-199f-44df-a732-4be50ff664bb" alt=""><figcaption><p>Filter context for header presets</p></figcaption></figure>

### 2. Context awareness in writeback

The filter selections are captured in the writeback table as separate columns. In the example below, the Segment and Region selections are captured as part of the writeback.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FTLc8IFruZHfZ48aRU7WW%2Fimage.png?alt=media&#x26;token=0e081735-6cbc-4a7b-a64a-34046611bb17" alt=""><figcaption><p>Writeback for Home Office + West selection</p></figcaption></figure>

When the Segment and Region selection is changed to Corporate + Central, the notes and comments are inserted as separate rows in the snowflake destination and tagged against the changed categories.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2Fut0X7t2cFWgQYxqJoAXp%2Fimage.png?alt=media&#x26;token=850f36de-852e-479b-830c-c6baa2c41905" alt=""><figcaption><p>Writeback for Corporate + Central selection</p></figcaption></figure>

### 3. Context awareness for data input fields

With Inforiver, manual data entry fields like textboxes, dropdowns, or numeric input will also be responsive to slicer selections. Notice how the data inputs change according to the filter selections in the gif below.

{% hint style="info" %}
When working with context awareness, you need to select a category(ies) in the external filters for writeback and data input to be enabled.
{% endhint %}

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FI8Ws4sYp2Kioc0FsQePj%2F2.1.%20Filter%20Context%20-%20data%20input%20gif.gif?alt=media&#x26;token=7a0076f7-0c03-41f1-a781-a4b5b1eb157a" alt=""><figcaption><p>Data inputs changing in response to filter selections</p></figcaption></figure>

### 4. Context awareness for writing back data input fields

The data input cells that are written back will also be determined based on filter selections.  In the screenshot below, the report has 3 data input columns: Benchmark, Progress, and Status. Notice how the data input fields were written back to the snowflake destination for the Consumer + January + First Class selection.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F8qlRRMWdazbdp2DbnEhU%2Fimage.png?alt=media&#x26;token=98c2544e-5258-4695-92e1-71a03548a82d" alt=""><figcaption><p>Writeback for data input columns based on external filter selection</p></figcaption></figure>

When the selection is changed to Home Office + October + Standard Class, the data inputs corresponding to the selection are written back as shown below. The data input fields for each filter selection are captured as separate rows in the destination.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2Fofm3kJGkmIVf6vIlFm7b%2Fimage.png?alt=media&#x26;token=03e2e5ed-fda4-41b6-acee-692891fe3584" alt=""><figcaption><p>Writeback for data input fields after changing the selection</p></figcaption></figure>

### 5. Context awareness in measure headers

Individual measure headers can also be configured to reflect slicer selections. Double-click the measure header and click Ctrl + Space to open the suggestions panel. The list of slicers/filters will be displayed in the suggestions list. Select the filter name to append it to the measure header.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F1OKExbmfFtRzwZoyk2zN%2Fimage.png?alt=media&#x26;token=e4dd441e-5921-4773-931c-7433fc219265" alt=""><figcaption><p>Appending slicer selections to the measure header</p></figcaption></figure>

Notice how the slicer selection is reflected in the measure header.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FZ0IYLh2nkSyOIzElAXjb%2Fimage.png?alt=media&#x26;token=da0cb211-58f3-425d-84ca-d85aa7047293" alt=""><figcaption><p>'Corporate' + 'Qtr 2' selection appended to the header</p></figcaption></figure>

### 6. Context awareness for locked cells

After entering a data input value, users can choose to lock the cell to prevent other report users from overwriting the value. When you change slicer selections, locked cells will be retained. In the gif, notice how the Tax measure that is locked for *Furniture* is persisted even after changing slicer selections.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FL6jB5HfTl8k0lZbSKAV6%2FUntitled%20Project.gif?alt=media&#x26;token=a933dd40-4f9b-4055-aa73-62fafae11e2f" alt=""><figcaption><p>Context awareness for locked data input cells</p></figcaption></figure>

### 7. Context awareness for Infobridge connected planning

Connected planning reports often have varying granularities. For example, you may have a regional budget that is cascaded into a global budget target report. The target report is likely to have slicers on dimensions like quarters, product lines, tax segments, etc.

Inforiver’s built-in context awareness has been extended to Infobridge sources - enabling context-aware connected planning. Let’s look at a quick demonstration. Our bridge contains quarterly Discounts that we need to integrate into our yearly profitability report.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FyVDuidZKzYtDm7fs5176%2Fimage.png?alt=media&#x26;token=6d8023a6-148d-4204-a868-ca33141c308e" alt=""><figcaption><p>Infobridge source</p></figcaption></figure>

The target Yearly Profitability report contains data at year level. Before integrating the discounts from Infobridge, let’s use Inforiver’s Super Filter visual to set up context awareness in the target.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FgYC4zIQn1AhfPFSvl9iN%2Fimage.png?alt=media&#x26;token=be78ea78-6d6b-4568-98de-4f69789779df" alt=""><figcaption><p>Setting up filter context with the SuperFilter visual</p></figcaption></figure>

The target visual has data at a higher granularity, i.e. year-level and the source bridge has quarterly data. When we create an integration to the discount bridge, we need to map the Quarter dimension to the filter context measure in the target profitability visual.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2Fj7KrujF8DJdhMc8V6sif%2Fimage.png?alt=media&#x26;token=da77acb1-4e6b-4175-9e54-5ebe6336f56d" alt=""><figcaption><p>Create integration</p></figcaption></figure>

{% hint style="info" %}
When you need to import a measure/column from Infobridge, the filter context measure needs to be mapped to the column dimension. When you import rows and have a slicer for row dimensions, the filter context measure should be mapped to the row dimension.
{% endhint %}

Notice how the Infobridge measure, Discount, also changes in response to slicer selections.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FtRoIsemb2x59PjzW5icz%2F7.4.4.%20context-aware-data-integration.gif?alt=media&#x26;token=2432c9bd-52f0-48cc-9659-3df02265364c" alt=""><figcaption><p>Context awareness for Infobridge measures/columns</p></figcaption></figure>

12. Copy values from one Filter context to another.

## 8. Context awareness to copy values from one Filter context to another.

You can copy values from one filter context to another easily for your data input measures with the new **Copy Context Filter** option added under the 'Filter Context' icon in the measure section of the Insert tab.

In the 'Copy Filter Context' pop-up, select the Source and the destination and copy values. Here, we have used Super-filter to filter the regions on the right side pane.

In the image below, the values from Canada is copied to France.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FzIPw8NekZPEPPiZXGpM3%2Fimage.png?alt=media&#x26;token=273bac54-77e4-48c2-89fd-568c233a885c" alt=""><figcaption><p>Copy Filter Context.</p></figcaption></figure>
