
1. Re: How do I calculate ratio with 2 different domains in a dimension when using a calulated field?
Peter Fakan Jun 24, 2019 7:44 PM (in response to Eugene Huynh)Hi Eugene, can you post a v10.5 please ?
File > Export as version...
Peter

3. Re: How do I calculate ratio with 2 different domains in a dimension when using a calulated field?
Anuvir Singh Jun 24, 2019 10:17 PM (in response to Eugene Huynh)Hi Eugene,
Try the following formula for All False Alarms and similar for All Fires.
sum(IF ([Callout_type]) = "ALL FALSE ALARMS" THEN {fixed [Callout_type]:[Total Incidents]} END)

4. Re: How do I calculate ratio with 2 different domains in a dimension when using a calulated field?
Eugene Huynh Jun 25, 2019 3:22 AM (in response to Peter Fakan)Here you go!

LFB_v10.5.twbx 403.3 KB


5. Re: How do I calculate ratio with 2 different domains in a dimension when using a calulated field?
Eugene Huynh Jun 25, 2019 3:27 AM (in response to KALPIT GOYAL)Hi Kalpit,
Here is the SHP file I used

London_Borough_Excluding_MHW.shp.zip 269.2 KB


6. Re: How do I calculate ratio with 2 different domains in a dimension when using a calulated field?
Eugene Huynh Jun 25, 2019 3:40 AM (in response to Anuvir Singh)Thank you for your reply.
I don't seem to be returning the correct values when using this formula and I still get the aggregation error

7. Re: How do I calculate ratio with 2 different domains in a dimension when using a calulated field?
Eugene Huynh Jun 25, 2019 7:41 AM (in response to Eugene Huynh)I relase I didn't extract the data when I attached my workbook. Here is the correct version!

LFB Eugene Huynh.twbx 467.7 KB


8. Re: How do I calculate ratio with 2 different domains in a dimension when using a calulated field?
Anuvir Singh Jun 25, 2019 7:48 AM (in response to Eugene Huynh)Attached is the updated file. Let me know if this works for you. I have changed the False Alarms per fire formula. Check it out.
Thanks,
Anuvir.

LFB Eugene Huynh.twbx 466.3 KB


9. Re: How do I calculate ratio with 2 different domains in a dimension when using a calulated field?
Eugene Huynh Jun 25, 2019 8:35 AM (in response to Anuvir Singh)Thank you for your reply I do seem to get the correct ratio when I use the formula, however my intention is so that the ratio reflects the bourough(s) filtered. At the moment it seems that the ratio calulation stays the same.

11. Re: How do I calculate ratio with 2 different domains in a dimension when using a calulated field?
Eugene Huynh Jun 25, 2019 9:14 AM (in response to Anuvir Singh)yes thank you! This is what I was looking for. If you don't mind could you explain your formula and why it works so I can understand it?

12. Re: How do I calculate ratio with 2 different domains in a dimension when using a calulated field?
Anuvir Singh Jun 25, 2019 9:38 AM (in response to Eugene Huynh)Sure so we can read this formula as follows for each Callout_Type and Borough compute the total incidents.
why did i use fixed in this
1) In the Calc Total incidents is an aggregate and callout type is a non aggregate. In order to use them together both of them should be at the same level either aggregate or non aggregate. So in order to convert a measure into a non aggregate from an aggregate we use a LOD.
2) when using the calc we have to keep in mind what level do we want the calc to be on. so we fix them on Callout_Type and Borough.
Attached is a good link that you can refer if you want more info on LOD calc.
Tableau Tip Tuesday: FIXED Level of Detail Expressions in a Plain English Sentence