7 Replies Latest reply on Apr 9, 2015 5:37 AM by Yuriy Fal

    How to create a moving average based on lower level of hierarchy?

    Ryan Kowalk

      I currently am working with a data set where I need to create a moving average based on levels of a hierarchy.  In the hierarchy I am currently working on I need to do a different average than what tableau normally does. Standard averaging is taking the lowest level data and averaging it to get the highest level of displayed hierarchy.

       

      Rather than using an average of the lowest parts, I am hoping to average at each level of the hierarchy. So in the table below, fruit is made up of an average of strawberry orange and apple.  Food is made up of an average of the already calculated averages of fruit, vegetable and deliciousness.

       

      I've tried table calculations to no avail, any help would be greatly appreciated.

      Level1Level2Level3

      Food

      FruitStrawberry
      FoodFruitOrange
      FoodFruitApple
      FoodVegetableSquash
      FoodVegetableBroccoli
      FoodVegetableSpinach
      FoodDeliciousnessNutella
      FoodDeliciousnessMore Nutella