Ja, muß man unbestritten zugeben. Auch daß in den Totals keine Min/Max-Funktionen unterstützt werden, hat mich schon bitter gefuchst.
Ev. hilft das?
Quelle Notes411 (glaube ich):
If your numeric list is an item called NumberList, the following formula will return its largest element:
tmpOnes:=@TextToNumber(@Explode(@Repeat("-1,";@Elements(NumberL ist))));
tmpA:=tmpOnes**NumberList;
tmpB:=NumberList**tmpOnes;
@TextToNumber(@Unique(@Trim(@Replace(@Text(NumberList);@Text(( @TextToNumber(@Unique(@Trim(@Replace(@Text(tmpA-@Max(tmpA;t mpB));"0";""))))*+NumberList));""))));
How does it work? OK. Here goes:
Suppose the list is 1, 3, 5.
We create two new lists (tmpA and tmpB) as follows:
tmpA tmpB
-1 -1
-3 -1
-5 -1
-1 -3
-3 -3
-5 -3
-1 -5
-3 -5
-5 -5
@Max these two lists to get a new list where each element is the greater of the two elements in tmpA, tmpB:
-1
-1
-1
-1
-3
-3
-1
-3
-5
Note that -5 (the smallest value) only occurs once. It can only be the greatest value when compared with itself. So, pairwise-subtract this list from tmpA:
0
-2
-4
0
0
-2
0
0
0
Convert to text, replace all the "0" with "", trim, make unique, and convert back to numbers. You are left with just -2 and -4.
Now, permute-add NumberList to this:
-1
-3
1
-1
-3
1
The last couple of steps have basically removed the greatest element.
Finally, convert this to text, replace the elements of number list that coincide with this list with a null. Trim, make unique, convert to a number and you are left with the greatest number in NumberList.