Hide Columns with 0 or null data

Is there an easy way to hide a column if the output is 0 or null? I have created a table where you can filter between units. These units do not contain the same data so a lot of columns will show up null or empty when changing between tables.


Hi Patrick,

I believe you will need to use script to hide the columns dynamically. It is possible to show/hide fixed columns by ways you already may know. But on filtering, if two different tables are getting switched between where different columns may end up with zeros, scripting should be the way to go.

If this is not the scenario, can you please explain a bit more so that I can suggest better?

Thanks Upasana,

That is what I am trying to accomplish, see the mock up I have below. When I filter to Unit B
I would want the last three columns to hide since they are 0.


If dataset is this small and it is a simple/straightforward setup, then you can think of switching between two different tables (show/hide) for those two filter values, and then design each of the tables appropriately. No script is required in that case.
But if it is the same table that just shows filtered data, then you will need script to hide columns based on values.

Good idea @upasana. Let me give it a try and see what I come up with.

So I was able to use radio buttons to select a layer and then when the layer is hidden or shown, hide the columns that were unwanted.

Thanks for the advice!

1 Like