Adding custom filters to data using calculated fields using ifelse with different logic for each condition

I would like to add a custom filter to a table viz that would filter the data in the table based on the given filter. For example, if the dataset contains query, owner, Id, updated_date,rowCount, run_time, execution_time, I want to add filter with the options - All, rowCount>100, execution_time>10mins, run_time <5mins. When All is selected, the entire dataset should be shown in the table , when rowCount>100 is selected then only those queries with rowCount>100 should be shown, if execution_time>10mins is selected then only those queries with execution_time>10mins should be shown and when run_time <5mins is selected only those queries with run_time <5mins should be shown. All the columns should be displayed in the table for all options.

You can make calculated fields a parameter and attach a filter for each of them.

Let’s just do it for rowCount.

First make a paramater called rowCountParam with a static default of ‘All’

Then make a calculated field, rowCountFilter.

ifelse(${rowCountParam}=‘All’,1,${rowCountParam}=‘rowCount > 100’ AND rowCount>100,1,0 )

Then make a filter that refenced the rowCountFilter and have it equal to 1.

Then you would do that for all of your other fields.

Hope that helps!

Hi @nive276!
Did this response answer your question? If not, what other questions do you have?

Thanks,
Kellie