5 Replies Latest reply on May 16, 2016 7:26 AM by Andrew Watson

# Tablea calculation/calculate the rate

I have question to table calculation. My data source looks like this one: I would like to calculate the rate of E-Mail Opt-in. In excel I would count all E-Mail Opt-in and divide the sum by the number of all sent print mailings (Thema 1) = 5/19 = 26%. How can I calculate this quote with tableau?

Thank you in advace!

Best

DS

• ###### 1. Re: Tablea calculation/calculate the rate

COUNT(IF [Arten] = 'E-mail Opt-in' THEN [WDEM] END)/COUNT([WDEM])

• ###### 2. Re: Tablea calculation/calculate the rate

HI Andrew, thank you for your replay. I tried it out and this is my result: the Rate of opt-ins is 15,15% . But it is wrong. The correct answer is 26% (5 E-Mail Opt-ins / 19 sent print mailing).  I tried to rewrite the formula to

COUNT(IF [Arten] = 'E-mail Opt-in' THEN [Arten] END)/COUNT([Arten]) But I get the same result. Do you have any ideas why? And how can I get the correct answer, Please see my workbook attached.

Thank you!

Best

• ###### 3. Re: Tablea calculation/calculate the rate

Ok, I understand, I didn't calculate beforehand. I provided the count of all Opt Ins / ALL where you want the count of all Opt Ins / Count of all that are NOT opt in. This is provided below.

COUNT(IF [Arten] = 'E-mail Opt-in' THEN [WDEM] END)/COUNT(IF [Arten] != 'E-mail Opt-in' THEN [WDEM] END)

• ###### 4. Re: Tablea calculation/calculate the rate

unfortenately with this formula I get wrong result 17,86% if I rewrite formula to COUNT(IF [Arten] = 'E-Mail Opt-in' THEN [Wdem] END)/COUNT(IF [Arten] != 'Thema 1' THEN [Wdem] END) --> I get also wrong result 35,71%.

I don't understand where is the mistake. It would be very kind from you if you could take a look one more time. Thank you!

• ###### 5. Re: Tablea calculation/calculate the rate

I can't open your workbook as it's in a later version of Tableau. However the formula looks correct. I attached a workbook containing the above formula based on your formula and the 26% is returned.