I am trying to take the minimum of a set of fields, excluding 0's. I am fairly new to using calculated fields in Tableau.
I have been able to chain the min function like so:MIN(MIN(MIN([a],[b]), [c]), [d]) etc...
However, I can not figure out a way to filter out the 0s for every one of my measures. I tried something with REGEXP_REPLACE. I also tried to set a larger IF THEN for the values with something like:
IF [a] > 0 THEN [a]
IF [b] > 0 THEN [b]
So that the new values would be nulled out. But, this didn't work either due to my need to chain all of them in this one calculated field. What is a functional way to calculate something like this? Assuming I can not modify the data outside of Tableau, what is a way to handle modifying multiple fields like this?
Desired Result:
(Pseudo Code)
given that a,b,c,d,e = 15,0,10,0,25
Min_No0([a],[b],[c],[d],[e],...) = 10