cartercjb
04-20-2022ETL
BLOX DROPDOWN - FILTER OPTIONS
I referenced this KB article to create a BLOX dropdown list as a filter. Here is a screenshot of my dashboard:
The BLOX code I used to create the dropdown is at the bottom of this post. I want to filter the available drop down options to only show those that have data associated with them in the charts below. The reason is because the dropdown list contains a ton of available options, most of which result in no data, as seen here:
{
"style": {},
"script": "",
"title": "",
"titleStyle": [
{
"display": "none"
}
],
"showCarousel": true,
"carouselAnimation": {
"showButtons": false
},
"body": [
{
"type": "Container",
"style": {
"padding": "15px"
}
},
{
"type": "ColumnSet",
"separator": false,
"spacing": "default",
"columns": [
{
"type": "Column",
"width": "175px",
"items": [
{
"type": "TextBlock",
"size": "small",
"weight": "regular",
"wrap": true,
"text": "Select Service Code",
"style": {
"color": "0057B8",
"padding-left": "15px",
"margin-left": "10px",
"backgroundColor": "white"
}
}
]
},
{
"type": "Column",
"spacing": "none",
"width": "175px",
"items": [
{
"type": "Container",
"spacing": "none",
"width": "150px",
"items": [
{
"type": "Input.ChoiceSet",
"id": "data.filters[0].filterJaql.members[0]",
"class": "",
"value": "97110",
"displayType": "compact",
"choices": "{choices:Service Code}"
}
]
}
]
},
{
"type": "Column",
"spacing": "none",
"width": "175px",
"items": [
{
"type": "Container",
"spacing": "none",
"width": "80px",
"selectAction": {
"type": "sort value",
"title": "sort",
"data": {
"widgetToSort": "625e527ad71ae23f5c342cec",
"sortDirection": "desc",
"valueIndexToSort": "0"
}
},
"items": [
{
"type": "ActionSet",
"margin": "0px",
"padding": "0px",
"actions": [
{
"type": "Filters",
"title": "Filter",
"data": {
"filters": [
{
"filterJaql": {
"explicit": true,
"members": [
"{panel:Service Code}"
]
},
"dim": {
"title": "Service Code",
"table": "Service Type",
"column": "Service Code",
"datatype": "text"
}
}
]
}
}
]
}
]
}
]
}
]
}
],
"actions": []
}
Hi cartercjb
If I am not mistaken you can add a widgetfilter to only show 'Service Code' when the count of a measure is higher then 0.
Example:
Without filter it shows 5 items:
With filter it shows only 3
In my case 'Ligdagen' is filtered on >0