Create SQL Where clause from Filter

Are there any existing methods to convert an active filter to a SQL Where clause? We have another dataset that we'd like to restrict to the same rows as those filtered in the primary grid.

Sorry, there is currently unfortunately not a built-in option for this.