I think I have it figured out, but let me know if I missed the mark. I think these three steps will get you what you want.
- Create a calculation for your category/sub-category alternative. It will look like this: IF COUNTD([Sub-Category]) > 1 Then ATTR([Category]) Else ATTR([Sub-Category]) END
- Drag the Category field onto the rows shelf and hide it by unchecking "show header".
- Drag the new calc onto the rows shelf.
Dynamic Filters (WM v1.0).twbx 347.7 KB
Do you want to show only one category/subcategory at a time?
if so you can create a parameter and use the "Add from Field" to add both category and subcategory data,
then create a calculated field
IF [Category Param] = [Sub-Category]
ELSEIF [Category Param] = [Category]
then put "Categories" into the filter and exclude "Null"
then you can choose whichever category/subcategory you want.
but using this way, you can only select one category/subcategory at a time.
This works perfectly! Thank you for your time.
Any idea if we introduce another layer to it. Say we have Segment-> Category-> Sub-Category.
If user selects 1 Sub-Category, we need to show Sub-category,
If user selects more than 1 Sub-Category, we need to show Category
If user selects more than 1 Category, we show Segment.
Is this doable?
I've tried to replicate what you're looking for, but I'm still not 100% sure if the cascading logic will work as intended. Here's something that should work.
I used Category - > Sub-Category - > Manufacturer in my example. Substitute the previous calculation I gave you with the following nested logic:
IF COUNTD([Sub-Category]) > 1 Then ATTR([Category])
Else (IF COUNTD([Manufacturer]) > 1 Then ATTR([Sub-Category]) Else ATTR([Manufacturer]) END)
Let me know if this doesn't work.