How can I apply filter on columns using the table function