5 Replies Latest reply on Sep 28, 2016 4:02 PM by Wesley Magee

    Dynamic Row Data

    Tina Matt

      Hi,

       

      I am trying to populate dynamic column names based on filter selection. I have attached a workbook for your reference.

       

      Basically what I want is, when a user selects a Sub-category, we want to show the Sub-Category filter value but when he selects all values in Sub-Category, we want to show Category value.

       

      For example, when a user selects "Binders" from Sub-Category, we want display "Binders" in the row where as when user selects "All", we want to show "Office Supplies".

       

      Any idea.. please let me know.

       

      Thank You for your time.

        • 1. Re: Dynamic Row Data
          Wesley Magee

          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.

           

          1. 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
          2. Drag the Category field onto the rows shelf and hide it by unchecking "show header".
          3. Drag the new calc onto the rows shelf.

           

          -Wesley

          • 2. Re: Dynamic Row Data
            Alex Xu

            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]

            THEN [Sub-Category]

            ELSEIF [Category Param] = [Category]

            THEN [Category]

            END

            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.

            • 3. Re: Dynamic Row Data
              Sreekanth Kasaraneni

              Hi Tina,

               

              please check the below link, this might help you.

               

              Identifying (and Using) Quick Filter Selection Status | Drawing with Numbers

              • 4. Re: Dynamic Row Data
                Tina Matt

                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?

                • 5. Re: Dynamic Row Data
                  Wesley Magee

                  Tina,

                  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)

                  END

                   

                  Let me know if this doesn't work.

                  -Wesley