A filter drop-down menu can be integrated into a report to "play" with the data and quickly filter different target groups.
Example:
Step 1: Create a report or select a saved report
Step 2: Open report settings
Step 3: A defined filter drop-down menu can be set for each tab. For this, code must be written, which must be saved in the respective tab selection.
Step 4: Create code
Example:
[{"name": "country", "color": "#fff", "filter": 431, "multiple": true}, {"reset": "Reset all filters"}]
Explanation:
"name": Name of Drop-Down, e.g., "country"
"filter": Row-ID of used filter variable in Codebook
"multiple": When multiple selections are allowed
"reset": Drop-down so that all filters are reset again
Any number of filter drop-downs can be strung together, for example:
[{"name": "Country", "color": "#fff", "filter": 3, "multiple": true},{"name": "Group", "color": "#fff", "filter": 7},{"name": "Gender", "color": "#fff", "filter": 10}, {"name": "Age", "color": "#fff", "filter": 16, "multiple": true }, {"name": "Social Media", "color": "#fff", "filter": 352, "multiple": true }, {"reset": "Reset all filters"}]
Datepicker or time series menu
For time-series analyses, a drop-down field can be integrated for the selection of the time window.
Example:
Code:
[{"name": "Time", "date": true, "ranges": ["currentWeek", "currentMonth", "currentQuarter", "currentYear"]}, {"reset": "Reset"}]
Explanation:
"name": "Time" - Name of the Dropdown
"date": true - Activation of Datepicker
"currentWeek", "currentMonth", "currentQuarter", "currentYear" - Selection of the selectable periods
Possible time periods: "ranges"
today: "today"
yesterday: "yesterday"
last 7 days: "7days"
30 days: "30days"
current week: "currentWeek"
last week: "lastWeek"
current month: "currentMonth"
last month: "lastMonth"
current quarter: "currentQuarter"
last quarter: "lastQuarter"
current year: "currentYear"
last year: "lastYear"
all dates: "all"
Possible default/standard settings: "date"
"minimumDate": "2016-01-01" <- sets the start time when selecting the entire period to January 1, 2016.
"defaultRange": "all" <- sets the start default to the entire period (if the option is omitted, it will be the last week).
Example: {"name": "Date", "date": true, "defaultRange": "all", "minimumDate": "2017-03-01","ranges": ["all","currentMonth", "currentQuarter", "currentYear"]}, {"reset": "Reset"}]
Kommentare
0 Kommentare
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.