3 Replies Latest reply on Jun 20, 2013 7:31 AM by Alex Kerin

    Filter - show all children of a parent, if one or more children match a criteria

    Andrew Prolov

      Hi everyone,

       

      I want to create a filter that returns all the (children) dimension of a (parent) higher-dimension, if one of the children meets the test criteria. In this sample data set, the test is: "are there 1 or more  chickens in a barn?"

       

      Easiest to explain with a sample dataset (twbx attached).

       

      BarnAnimalHeadcountChickenCount
      AChicken1010
      ACow10
      APig10
      BCow50
      BPig50
      CChicken2020
      DChicken11
      DPig50

       

      There are 4 barns (A,B,C,D), each having one or more animals types (chicken, cow, pig) .

      I want to create a filter that identifies which barns contain 1 or more chickens (answer: A, C, D)... but what makes it tricky is I want to still see what other animals are in the barn with the chicken.

       

      The final result should look as follows (Barn B is filtered out, but A, B, D remain and all the animals within)

       

      BarnAnimalHeadcountChickenCount
      AChicken1010
      ACow10
      APig10
      CChicken2020
      DChicken11
      DPig50

       

       

      Thanks in advance,

      AP