How to link 'Filters' across multiple data-grids?

https://learninghub.kx.com/forums/topic/how-to-link-filters-across-multiple-data-grids

Hey there,

 

Apologies for the novice question.

 

I am building out a dashboard with several tabs each having their own data-grid, but all coming from the same table - an absolute behemoth of 200+ columns that only displays certain columns based on which tab you are on (surprisingly most efficient and effective way to display such data, having buttons that filtered the table was a nightmare in terms of speed).

 

However, they all do share one column in common, with the exact same length and elements, and of a symbol type. How can I make it such that when you input in a string into the filter of this column, it appears across all data-grids?

 

I can see there is a way to input a viewstate in both the ‘Filtering’ option under ‘Basic’ as well as under ‘Custom Filters’, but can’t seem to quite get the viewstate right.

 

Thanks all in advance

{[filterString] .dfilt.apply[dfxQuote; filterString] }

 

If you have a set of the Datagrids with the same query like above and you :

  1. set the “Filtering” property to “Advanced Column Filter”

  2. set the “KDB filter string” property to same shared viewstate

 

Then if you update a column filter in table 1, and go to table 2, then the same filter will be applied

If you then change the filter in table 2, this filter will be applied to table 1

 

 

If you need any further here, just let me know

Hi !

Have you had a look at our video on Querying Data using KX Dashboards? It includes a tutorial on how to create a view state. https://youtu.be/kTYSScDXDHc

If you still are unsure, let me know and I’ll go in to more detail.

Many thanks,

Megan

Hi Megan, thanks for your response!

 

I am not looking to filter the data at the source so that this is displayed in the data grid. Rather, I would like to apply column filters to my data and have this carry across multiple data grids. I am aware that the process to do so is by setting the same viewstate across all data grids but I am not sure where to link them and what type the viewstate should be.

 

There are several sections within the data grids for filtering, do I set the viewstate to be the same in ‘KDB Filter String’, ‘Custom Filters’, or some place else? Furthermore, I would be inputting text underneath a header to filter that column, so should the viewstate be type string or symbol?

 

I hope this provides clarity in what I am trying to achieve.