Filtering Datasets by row

LabKey Support Forum
Filtering Datasets by row WayneH  2018-06-01 13:17
Status: Closed
 

Good afternoon,

I just wanted to know if there was a way to filter by row.. For example what we are trying to do is filter datasets to show rows that are not blank rather than applying a notnull filter to each field... But apply a global filter by row..

thanks.

Wayne H

 
 
Jon (LabKey DevOps) responded:  2018-06-15 16:19
Hi Wayne,

Unfortunately there isn't a global way to do this via the regular grid UI.

You might be able to use the QueryWebPart in the Javascript API to apply filters to multiple fields, but that would take some programming effort on your end to accomplish this.

https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.QueryWebPart.html

Regards,

Jon
 
Will Holtz responded:  2018-06-20 11:03
Hi Wayne,

You could create a query over your dataset to add a calculated column that contains a boolean based on if the row if blank. Then the user can use the regular grid filtering on the calculated column to get the view you desire.

SELECT
   col1,
   col2,
   col3,
   col1 is NULL and col2 is NULL and col3 is NULL as blankRow
FROM myTable;

You would need to configure some metadata on that query if you want the user to be able to edit the underlying table from via grids displaying the query results.

-Will