I have a FileMaker database where I want to calculate the median value of 3 different fields. I used the code that can be found here.
In my setup, it looks like this:
Let ([
beak.trait = List (beak_depthA; beak_depthB; beak_depthC);
valuelist = SortValues ( beak.trait; 1);
count = WordCount ( valueList );
odd = MiddleValues ( valueList ; Truncate (count/2;0) +1 ; 1 );
even = MiddleValues ( valueList ; Truncate (count/2;0) ; 1 )];
Case( Mod ( count ; 2 ) ; odd ; (even+ odd) / 2))
When there is an even number of data in the cells it generates this:
However, when including 3 measurements, I get this:
But if I look into the data, it's there, with an extra line return...
Would there be a way to get the value, when the number of fields is odd without the extra return?
How the code would be affected?