4 Replies Latest reply on Nov 6, 2018 12:30 AM by Raquel Garcia

# Sintaxis: How to create a Calculated Field for with multiple condition formulas?

• ###### 1. Re: Sintaxis: How to create a Calculated Field for with multiple condition formulas?

Hi,

Does this represent only one calculation formula ?

SUM (IF ([E1_Nca]) = 1

then ([Resp_pond]) END) / sum (IF ([E1_Nca]) <> 0 then ([Resp_pond]) END)

SUM (IF ([E1_Nca]) = 2

then ([Resp_pond]) END) / sum (IF ([E1_Nca]) <> 0 then ([Resp_pond]) END)

SUM (IF ([E1_Nca]) = 3

then ([Resp_pond]) END) / sum (IF ([E1_Nca]) <> 0 then ([Resp_pond]) END)

If your answer is yes, you should start to replace the logical syntaxe by something like this:

SUM(

CASE [E1_Nca]

WHEN 1 THEN Calculation_To_Be_SumUp1

WHEN 2 THEN Calculation_To_Be_SumUp2

WHEN 3 THEN Calculation_To_Be_SumUp3

END

)

Cedric

• ###### 2. Re: Sintaxis: How to create a Calculated Field for with multiple condition formulas?

Thank you very much for your suggestion, Cédric.

De: Cédric Tran

Enviado el: viernes, 02 de noviembre de 2018 20:16

Para: Raquel Garcia

Asunto: Re:  - Sintaxis: How to create a Calculated Field for with multiple condition formulas?

Sintaxis: How to create a Calculated Field for with multiple condition formulas?

• ###### 3. Re: Sintaxis: How to create a Calculated Field for with multiple condition formulas?

Hi Raquel,

If it is Correct, could you please marked is as "Correct" ? It won't appear on the unanswer question anymore after that.

Thanks

• ###### 4. Re: Sintaxis: How to create a Calculated Field for with multiple condition formulas?

Hi Cédric,

Probably it works. But I do not know how to use it.

I am completly new with Tableau. And the sintaxis is really too "tricky" for me at this point.

In fact, my own formula, even only with 1 line, is reporte as "valid" by the syntax editor. But it does not work in fact.

So I have put this all on hold, and I will be releasing an easier chart.

Best regards,

Raquel