Can the filter definition from interactive filters be extracted

Hi Community,

does anybody know if you can extract (and further use) the filter definitions output of Interactive Value Filters?
I want to use the information what the user selected/filtered in the further processing, but as far as I can see I cannot get the information what was filtered in any usable form :frowning:

grafik

You can manually view the filter definition either in the filter definition port or in the table spec Filter Handler
grafik

The Filter Handler cannot be extracted with the Extract Table Spec node

Does someone have an idea how to get the Filter Definition as a string or xml?

example.knwf (8.7 KB)

Thanks in advance for any help :grin:

1 Like

Hi @AnotherFraudUser,

You can export the definition using the Model Writer node and use it later in Filter Apply node or any other nodes with a filter definition input port.

If you want to have the filtered values, just use the Filter Apply node after the Interactive Value Filter Widget node in the component and connect both definition and data ports then use a Groupby node to group your value column. That’s it.

23612-1-1.knwf (18.7 KB)

:blush:

4 Likes

Hi armingrudd,

thanks for the help!
With the Model Writer and unzipping the objectSpec I can extract the filter definitions from the spec.xml :slight_smile:
You are right about the Filter Apply and GroupBy (however as far as I can see this only works for filters on nominal columns with Interactive Range Slider Filter this gets harder - but for all nominal columns this should work fine!

2 Likes

For range slider, you can use min and max aggregations instead of getting unique values.

:blush:

1 Like

I think here the problem could be:
the user selects the range 5.5->10.2
But the table values in this range do not have to be in this exact range (so there could be a slight error just using min/max)

But thanks again for your help!
(both cases can be done with the Model-Writer way so my problem is solved :slight_smile: )

1 Like

You are right. I just wanted to provide an easier approach. But yes, to have the exact settings, unzipping the model is the solution. Thanks for sharing this solution. :+1:

:blush:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.