> For the complete documentation index, see [llms.txt](https://docs.noviship.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.noviship.net/reporting/variables.md).

# Variables

Variables are a Report Feature that allow the viewer of the report to make changes to the report filter without editing the report (or having edit permission).

There will be occasions when an operator wishes to make adjustments to a report without going through the process of creating a new report or editing an existing report.

This is accomplished by declaring that certain filter criteria are Variables.  The viewer of the report will be able to modify these Variables even if they don't have edit permission.  The Variables are shown in the report viewer where changes are quick and simple.

## Starting Report

Let's begin with a simple report to view the number of shipments for a specific courier, per month, over a given period.

![](https://1742679714-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnQQqtG9nPC-864yuG4%2F-MEi1ZEbLnwXisykXdvQ%2F-MEi46Bgg3-GgG7QUIHe%2Fimage.png?alt=media\&token=d0999656-9fc2-4164-871b-323cb43cabba)

We configure this report as a bar chart and when viewing it, we see the outcome

![](https://1742679714-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnQQqtG9nPC-864yuG4%2F-MEi1ZEbLnwXisykXdvQ%2F-MEi4Jm-q62GOPBs5nqE%2Fimage.png?alt=media\&token=a2ff9ebd-3016-4e5c-b671-c833171ce85c)

## Introducing Variables

Imagine that someone wants to modify the date range at will.  To do so they would clone the report and modify the filter.  However this leads to duplicate reports and the viewer needs to have permission to create and edit reports.

Instead we can declare the date range to be **variables**.

Go to the **Features Editor** for this report

![](https://1742679714-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnQQqtG9nPC-864yuG4%2F-MEi1ZEbLnwXisykXdvQ%2F-MEiD0j5s-UlnJx4HRuL%2Fimage.png?alt=media\&token=c78d112c-dada-41ea-99f9-b14571b407f7)

Here you can see what features have been configured for this report.

![](https://1742679714-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnQQqtG9nPC-864yuG4%2F-MEi1ZEbLnwXisykXdvQ%2F-MEiDAmmNjo6ASoR4_es%2Fimage.png?alt=media\&token=9713f8d5-409a-455d-82db-548a344df539)

Click **Add Item** in the Variables section to create a variable and select the start of the date range as the filter and describe the variable (the name will be displayed in the viewer).

![](https://1742679714-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnQQqtG9nPC-864yuG4%2F-MEi1ZEbLnwXisykXdvQ%2F-MEiDRs3ShWp71rHZZ9R%2Fimage.png?alt=media\&token=abf9c351-ca3c-4448-af29-5b4aebc20c6f)

Repeat this for the **Before** date as well.

![](https://1742679714-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnQQqtG9nPC-864yuG4%2F-MEi1ZEbLnwXisykXdvQ%2F-MEiDaHlOOVcSP3wrZfo%2Fimage.png?alt=media\&token=7d595490-f7a4-4496-a576-982b73b5ad12)

And save the changes.  Now when you view the report you will see the variables.

![](https://1742679714-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnQQqtG9nPC-864yuG4%2F-MEi1ZEbLnwXisykXdvQ%2F-MEiDlTRYBuUDVix7xoK%2Fimage.png?alt=media\&token=62827385-740b-4eca-a9b6-f63e2a8135b5)

Initially the variables will be set to the filter properties of the report.  To change them, click on the variable control and after you have changed the filter click **Update** to refresh the report.

Now imagine you want to allow the viewer to switch between Purolator, DHL and FedEx.  To do this simply add a variable for the **Courier** filter.

![](https://1742679714-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnQQqtG9nPC-864yuG4%2F-MEi1ZEbLnwXisykXdvQ%2F-MEiEKnjRmJdi278qp2N%2Fimage.png?alt=media\&token=bde9f8bc-e094-4e2e-a815-08db6e9ef4a6)

In this case we selected a **Choice** type.  Unlike **Text** which allows the operator to enter any text they wish, **Choice** offers a drop-down selection of pre-determined values.

In this example we used the `value=caption` format where the text displayed to the operator is on the right side of the quals sign while the actual value is on the left side.  This allows you to use the carrier codes with a tidy presentation.

And when viewing you will now see the additional variable.

![](https://1742679714-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnQQqtG9nPC-864yuG4%2F-MEi1ZEbLnwXisykXdvQ%2F-MEiEgpE6KfFSm-olpsI%2Fimage.png?alt=media\&token=8f5a2972-8940-477a-bd01-794088c524cc)
