Dashtable : Not possible to apply filter if there are Multiple headers?

Hello,

Following the documentation available here: https://dash.plot.ly/datatable/style, section “Multiple Headers”, I’m trying to find a way to apply a filter on some of my cell.

Problem : Every time I add the below lines to the provided example,

	        style_data_conditional=[
	                    {
	                        'if': {'column_id': 'temp', 'filter':'{temp} eq "-100"'},
	                        'fontSize': '4rem',
	                    }
	        ],

the page stays blank…

        dash_table.DataTable(
            columns=[
                {"name": ["City", "Year"], "id": "year"},
                {"name": ["City", "Montreal"], "id": "montreal"},
                {"name": ["City", "Toronto"], "id": "toronto"},
                {"name": ["City", "Ottawa"], "id": "ottawa", "hidden": True},
                {"name": ["City", "Vancouver"], "id": "vancouver"},
                {"name": ["Climate", "Temperature"], "id": "temp"},
                {"name": ["Climate", "Humidity"], "id": "humidity"},
                {'name': ['Step 1', 'Brand'], 'id': 'S1_Brand'},
            ],
            data=[
                {
                    "year": i,
                    "montreal": i * 10,
                    "toronto": i * 100,
                    "ottawa": i * -1,
                    "vancouver": i * -10,
                    "temp": i * -100,
                    "humidity": i * 5,
                    'S1_Brand': i+12,
                }
                for i in range(10)
            ],
        style_data_conditional=[
                    {
                        'if': {'column_id': 'temp', 'filter':'{temp} eq "-100"'},
                        'fontSize': '2rem',
                    }
        ],
            merge_duplicate_headers=True,
        ),

It looks like it’s not possible to apply filter if there are multiple headers. Is this correct, @chriddyp ??

…I had the dash-table v.3.6.0 on my dev machine, while the prod server is running with the 3.7.0…:man_facepalming:

filters were not available in v.3.6.0 :see_no_evil:

1 Like