Variables are used to dynamically load values into formulas and date intervals.
Creating variables
Only report author or report editor can create report variables and set their default values. Every other user that has access to the report, can only change report variable values.
To create a new filter, open the Variables sidebar.
- Click on Edit button to enter Variables dialog.
- Select which type of variable you would like to create:
- Date variable
- Text variable
- Number variable
- Optionally, change the identifier.
- Click on Add.
- Optionally, select default value. See below.
- Optionally, edit the Advanced settings to change the appearance and functionality of the variable. See below.
- Save the variable.
APPLYING VARIABLE AS RELATIVE DATE
- Display default relative dates by selecting option Use relative dates
- Allow Autosubmit after selection (every timeuser selects a value, the setting will be automatically saved)
- Select Display mode (Radio, Select, Checklist)
- Set Preset values (displayed Name of the value, and Definition of the value - g.e. "now-2d" as the day before yesterday)
In the definition of the value can be used following date strings:
Relative date | Actual value |
---|---|
now | Current day |
actualDay | Current day |
actualWeek | Current week (first day of week) For example, actualWeek selected on 21.9.2010 represents date 20.9.2010 (Monday of this week in calendar) |
actualMonth | Current month (first day of month) For example, actualMonth selected in 21.9.2010 represents date 1.9.2010 |
actualQuarter | Current quarter (first day of quarter) For example, actualQuarter selected on 21.9.2010 represents date 1.7.2010 |
actualYear | Current year (1st January of current year) For example, actualYear selected on 21.9.2010 represents date 1.1.2010 |
availableFrom, availableTo | Represents the first and last available date entry |
Relative and absolute date can be adjusted by operators using this syntax: date +|- n[d|w|m|q|y], where n is integer, d represents day, w represents week, m represents month q represents quarter and y represents year. We can for example define time in this way: actualyear + 2m -4d. Today is 21.9.2010, so this value represents 1.1.2010 + 2 months - 4 days, which means date 25.2.2010.
Modifier | Value |
---|---|
d | days |
w | week |
m | month |
q | quarter |
y | year |
TRANSLATING VARIABLES
It is possible to translate both the name of the variable and the preset values of a date variable. After clicking on the name or the value, users can select the language and add the translation.