# Hide Table Column if no values exist

**URL:** <https://forum.inductiveautomation.com/t/hide-table-column-if-no-values-exist/5119>\
**Category:** Archived Topics\
**Created:** [September 7, 2012, 5:17pm UTC](https://forum.inductiveautomation.com/t/hide-table-column-if-no-values-exist/5119 "2012-09-07T17:17:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkrugerud](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@jkrugerud](https://forum.inductiveautomation.com/u/jkrugerud)\
**Post date:** [September 7, 2012, 5:17pm UTC](https://forum.inductiveautomation.com/t/hide-table-column-if-no-values-exist/5119/1 "2012-09-07T17:17:56Z")

</div>

I am running the following query to populate a table:  
[size=85][color=#FF0000]SELECT \*  
FROM  
(  
SELECT pvp.MaterialDescription, pvp.CurrentPrice, cb.ShortDesc  
FROM  
po\_vendor\_prices\_1270 as pvp  
JOIN Codes\_Branch as cb  
ON (pvp.Branch = cb.Branch)  
WHERE cb.BranchGroup = ‘NW’ AND pvp.SupplierNo = ‘{Root Container.selectedName}’  
GROUP BY cb.ShortDesc, pvp.MaterialDescription, pvp.CurrentPrice  
) x  
pivot  
(  
sum(CurrentPrice)  
FOR ShortDesc  
IN ([ANCHORAGE],[BEND OR],[BILLINGS],[EUGENE OR],[PASCO WA],[PORTLAND],[TACOMA WA],[WHITE CITY],[WOODINVILL])  
) p[/color][/size]

I would like to hide the established columns that do not have values in any of the rows, I understand that I will have to tap into the Column Attributes Data via scripting but I’m not quite sure of how to this. Can I change my query to not create a column if values are NULL, would that be easier to do? What would the scripting look like to do this?
