# LOOKUP

The LOOKUP function can look up values from an Infobridge query and load them inside an Inforiver visual. It can fetch measure values directly from Infobridge without creating an integration and importing measures/rows into your report.  

## Syntax

```javascript
LOOKUP(queryIdentifier:string,measure:string,rows:[string],columns:[string])
//fetches data from the specified query and measure
```

## Arguments

queryIdentifier - String. Required. It is used to identify the query from which data has to be fetched.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FYdWJAYZdxJcQsWc0FS8p%2Fimage.png?alt=media&#x26;token=1f89c8a1-8089-4587-b70d-7a654083ef2f" alt=""><figcaption><p>Copy the query GUID from Infobridge</p></figcaption></figure>

key- String. Required. It specifies the key whose value is to be extracted.

rows - Array. Optional. Specify specific row dimension category values or use dimension names.

columns- Array. Optional. Specify specific column dimension category values or use dimension names.

## Examples

**Example 1:** Refer to a specific row and column and fetch the measure value from Infobridge.

The bridge contains the quarterly rebate rates for a set of products.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FTxLHSN6pWo6OdVxI6DNE%2Fimage.png?alt=media&#x26;token=2dfadf0c-b4c4-4577-9e13-ac128a25d1e0" alt=""><figcaption><p>Bridge to lookup measure values</p></figcaption></figure>

In the target visual, we can pull the rebate rate for the "Velo" product for Q4 using the LOOKUP function as shown.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FM9S9bwZxt2ah3OK2d44m%2Fimage.png?alt=media&#x26;token=40f21359-5ac6-4ef8-821f-8ea8307e4f4b" alt=""><figcaption><p>LOOKUP function for specific row and column dimension categories</p></figcaption></figure>

**Example 2:** Fetch values when the row and column dimensions are the same in the bridge and the target visual.

The bridge contains the country-wise rebate rates for a set of products.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FPeMwd0HddHUzujIpWLbF%2Fimage.png?alt=media&#x26;token=ce326d27-bcea-4c79-904f-141573e6590e" alt=""><figcaption><p>Bridge to lookup measure values</p></figcaption></figure>

In the target visual, we can pull the rebate rate without specifying the rows and columns. They are automatically mapped within Inforiver.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F4KQI6tbKsCaZfVoGUuHA%2Fimage.png?alt=media&#x26;token=a023e0b0-d257-42c3-ba6b-fba346f80a76" alt=""><figcaption><p>LOOKUP function when the row and column dimensions match in the bridge and target visual</p></figcaption></figure>

You can use the ROW/COLUMN identifiers when the row and column dimensions in the bridge and identical to the target visual.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FuCeIboSYkLuta9d5UJqo%2Fimage.png?alt=media&#x26;token=d93cdd0a-3c5d-4b3b-b0fb-7bffa6fccc01" alt=""><figcaption><p>Using the ROW and COLUMN identifiers</p></figcaption></figure>

**Example 2:** Fetch values when the row and column dimensions in the bridge and the target visual are not identical.

The bridge contains a flat discount rate for product categories.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FhtsjSzbE3fbnmZF6Pq6j%2Fimage.png?alt=media&#x26;token=729c7801-a0bc-42bc-9211-82c14d7c4fbf" alt=""><figcaption><p>Bridge to lookup measure values</p></figcaption></figure>

In the target visual, we can pull the discount rate although the the bridge does not contain column dimensions and the row dimension hierarchy is different.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FoTFJSxPh9TjPDV7phsRC%2Fimage.png?alt=media&#x26;token=f0e96ad0-8ac0-460b-8272-fbbc2955e0df" alt=""><figcaption><p>Lookup when dimensions do not match</p></figcaption></figure>

You can also fetch values from a bridge and map them to a visual column.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FSgQ3YjR9sLAlrzcmKpNB%2Fimage.png?alt=media&#x26;token=294ba0c4-c1fb-45a1-a535-62568dbc3abb" alt=""><figcaption></figcaption></figure>
