2 of 2 people found this helpful
The expression [Set Name] is a boolean that is true when the record belongs to (is IN) a set and false when the record does not belong to (is OUT of) a set.
( [Base Filter] == 'Include Base' AND BaseExcluded] )
([Base Filter] == 'Exclude Base' AND [BaseIncluded] )
Would give you True for records IN the set based on the parameter selection.
I ended up doing the following:
- Created two sets
- Created two calculated fields
- Calc_BaseExclude: IF [BaseExcluded] = FALSE THEN "Exclude Base" END
- Calc_BaseInclude: IF [BaseIncluded] = TRUE THEN "Include Base" END
- Then a third calculated field to add to the filters shelf that uses a parameter ([Base Filter]) so the user can choose to either 'Include Base' or 'Exclude Base'
CASE [Base Filter]
WHEN 'Include Base' THEN [Calc_BaseInclude]
WHEN 'Exclude Base' THEN [Calc_BaseExclude]
Adding the third calculated field to the filters shelf allows users to use the parameter to filter out the base or not.
Do you think this approach is ideal? Or, is there a better way?
- Created two sets
I was facing the same issue earlier today, but the solution is actually quite simple.
Basically, when create a set, it creates an invisible column in your data that's boolean- it's values are either true or false based on if that record (or row) is part of your set or not. Therefore, to accomplish your goal and get the ability to filter by the set, it's easier to just bypass all the parameter business and do the following:
Assuming that you've already created the sets- I'm calling them [set1] and [set2], all you need to do is create a single calculated field like this:
If [set1] = true then "set 1 label"
Elseif [set2] = true then "set2 label"
else "everything else"
Now, just put this calculated field onto the filter shelf or right click on it and "show quickfilter". When you select the different labels from the dropdown it will only show records that belong in the associated set.
-Ryan (feel free to accept my post as the answer if it solves your issue! thanks!)