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

# How to make a contribution to growth?

Hi,

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?

Thanks,

• ###### 1. Re: How to make a contribution to growth?

You could create a new calculated field with the formula and add it to your Measure Values:

[Dif]/WINDOW_SUM([Dif])

• ###### 2. Re: How to make a contribution to growth?

Thank you! It works.

I've just add ABS to keep the right sign on of the growth

[Dif]/ABS(WINDOW_SUM([Dif]))