-
1. Re: How to calculate a trim mean for a reference line?
Alex Kerin Dec 3, 2012 5:16 AM (in response to Ey Tan)You would need to create a calculation just like any other. It would involve window calculations as you would need to know what was to be trimmed. Do you have a formula you would like to use?
-
2. Re: How to calculate a trim mean for a reference line?
Ben Porter Dec 3, 2012 7:05 AM (in response to Ey Tan)Take a look at this. I think this is correct, but please check the calculation.
-
Trimmed Mean Example.twbx.zip 14.0 KB
-
-
3. Re: How to calculate a trim mean for a reference line?
Ben Porter Dec 3, 2012 7:26 AM (in response to Ey Tan)Realized a lower parameter control would be useful as well Updated.
-
Trimmed Mean Example v2.twbx.zip 13.5 KB
-
-
4. Re: How to calculate a trim mean for a reference line?
Ey Tan Dec 4, 2012 12:10 AM (in response to Ben Porter)Hello Ben, thanks for this. this method for trim mean works.
however when i right-clicked on my chart to view the data, the percentiles i got were up to 33% only. what did i miss?
-
donut sales.twbx.zip 19.3 KB
-
-
5. Re: How to calculate a trim mean for a reference line?
Tim Latendress Dec 13, 2012 1:09 PM (in response to Ben Porter)Hi Ben,
Thanks for posting this one. In the calculated field "Percentile", what is the purpose of subtracting .05 from INDEX()?
Percentile
(INDEX() -.05)/Total(Count([OrderID]))
--Tim
-
6. Re: How to calculate a trim mean for a reference line?
Ben Porter Dec 14, 2012 5:47 AM (in response to Tim Latendress)Tim,
Great question, maybe you can help answer it. I was using reference material from Stanford
Wikepedia has same equation.
http://en.wikipedia.org/wiki/Percentile
I sold my stats textbooks many many many moons ago. Can anyone help answer?
-
7. Re: How to calculate a trim mean for a reference line?
Ben Porter Dec 14, 2012 5:10 AM (in response to Ey Tan)Hi Ey,
The reason that it's not calculating correctly is that you don't have a unique id for the sale; I added a concatenated field Month + Outlet and it calculated properly. Also the trimmed mean you have on the monthly view is not calculating properly, it should go down when you lower the upper threshold (eliminating high range from median calculation). Why it's doing that is beyond me right now.
-
8. Re: How to calculate a trim mean for a reference line?
Tim Latendress Dec 14, 2012 5:41 AM (in response to Ben Porter)Hi Ben,
Thanks for posting a link to those papers. I see the calc in the Stanford paper and will dig deeper this weekend. It will give me a little light reading for the weekend.
--Tim
-
9. Re: How to calculate a trim mean for a reference line?
Ey Tan Dec 16, 2012 6:30 PM (in response to Ben Porter)hi Ben, I created a dummyID and my chart turns out weird. I've edited the formula to percentile involving the dummyID at the denominator but still my percentile range is not up to 99%.
Regarding the adjustment of the upper threshold resulting in higher trim mean, most likely it's because the data is made to display in descending order and the upper tails are the lower values.
-
donut sales.twbx.zip 23.1 KB
-
-
10. Re: How to calculate a trim mean for a reference line?
Jonathan DrummeyJul 12, 2016 2:30 PM (in response to Ey Tan)
A few years later, here's a version of TRIMMEAN() in Tableau that uses Level of Detail expressions:
TRIMMEAN() in Tableau | Drawing with Numbers
Jonathan