cancel
Showing results for 
Search instead for 
Did you mean: 

BLOX DROPDOWN - FILTER OPTIONS

cartercjb
10 - ETL
10 - ETL

I referenced this KB article to create a BLOX dropdown list as a filter. Here is a screenshot of my dashboard:

cartercjb_0-1650468280370.png

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:

cartercjb_1-1650468638659.png

 

 

 

{
    "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": []
}

 

 

1 ACCEPTED SOLUTION

HamzaJ
12 - Data Integration
12 - Data Integration

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:

HamzaJ_0-1650490021072.png

With filter it shows only 3

HamzaJ_1-1650490066661.png

In my case 'Ligdagen' is filtered on >0

HamzaJ_2-1650490077152.png

 

 

View solution in original post

2 REPLIES 2

HamzaJ
12 - Data Integration
12 - Data Integration

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:

HamzaJ_0-1650490021072.png

With filter it shows only 3

HamzaJ_1-1650490066661.png

In my case 'Ligdagen' is filtered on >0

HamzaJ_2-1650490077152.png

 

 

DUH! So simple, but so effective! I didn't even think about this. Thank you!!