2 Replies Latest reply on Aug 22, 2012 6:44 AM by Sammuel Alvares

    How to make a contribution to growth?

    Sammuel Alvares


      I'm trying to calculate how much a line growth contributed to the total growth in percentage. I have sales in this summer and last summer. I need a calculated field as:

      ((Sales this summer)-(Sales last summer)) / Total(Sales last summer)


      I've tried this: (ZN(SUM([Valor])) - LOOKUP(ZN(SUM([Valor])), -1)) / lookup(total(sum([Valor])),-1)

      The problem is that this (ZN(SUM([Valor])) - LOOKUP(ZN(SUM([Valor])), -1)) should be Table(Across) and this lookup(total(sum([Valor])),-1) should be Table(Down). How can I do it?

      I can also make this calculated field like:

      ((Sales this summer)-(Sales last summer)) / Total((Sales this summer)-(Sales last summer))

      I've made a field "Dif" as (ZN(SUM([Valor])) - LOOKUP(ZN(SUM([Valor])), -1)) and then I tried to create another field as Dif / Total(Dif). However, Tableau doesn't allowed me to use a Table calculation field to create another Table calculation field.


      Do you have any ideia how to solve it?