12 Replies Latest reply on Jun 25, 2019 9:38 AM by Anuvir Singh

    How do I calculate ratio with 2 different domains in a dimension when using a calulated field?

    Eugene Huynh

      Hi!

       

      I'm new to tableau trying to calculate the ratio of false alarms to fires but I keep getting errors. I first started by summing up all the incidents in "Total incidents" in a calulated field. Then I created 2 separate clauses for my ratio calculations as follows:

       

      IF ATTR([Callout_type]) = "ALL FALSE ALARMS" THEN [Total Incidents] END

       

      and

       

      IF ATTR([Callout_type]) = 'ALL FIRES' THEN [Total Incidents] END

       

      and finally the ratio calculation:

       

      SUM([All False Alarms])/SUM([All Fires]) but I keep getting an error.

       

      I think the issue arises because "Total incidents" is a calculated field and I cannot aggregate this further but I'm not sure how to go about this. Any help would be appretiated! I have attached my workbook for you to have a look