
1. Re: Return Min Max in Calculated Field
Tracy Rodgers Jul 6, 2012 10:51 AM (in response to Dani Schmid)Hi Dani,
Do you want the two entries to be combined? As in they are added together or would you like them to show as two different values, but using one calculated field?
For the first scenario, the calculation might look similar to the following:
min([Profit]) + max([Profit])
For the second scenario, in order for them to both show up, the values will need to be turned to strings. Therefore, the calculation may look similar to this:
"$" + str(min(Profit)) + ", $" + str(max(Profit))
Hope this helps a bit!
Tracy

2. Re: Return Min Max in Calculated Field
Dani Schmid Jul 8, 2012 6:28 AM (in response to Tracy Rodgers)Hi,
thanks for this. But what I want is the following:
Assume that I have table that consists of one column called Xall, which has
the following entries:
1
2
3
4
5
I want to calculate a field Xcalc that only contains two entries: the minimum AND the
maximum value of Xall, i.e.
1
5
Can this be done?
Cheers,
Dani

3. Re: Return Min Max in Calculated Field
Tracy Rodgers Jul 9, 2012 9:11 AM (in response to Dani Schmid)1 of 1 people found this helpfulHi Dani,
To show the two values within the same calculation, the formula would need to look similar to the following:
str(window_min(sum([Order Quantity]))) + "; " + str(window_max(sum([Order Quantity])))
The other option would be to create two different calculations:
window_min(sum([Order Quantity]))
window_max(sum([Order Quantity]))
Since table calculations are being used in these calculations, it may be necessary to right click and select Compute Using>the appropriate direction.
Hope this helps!
Tracy

4. Re: Return Min Max in Calculated Field
Dani Schmid Jul 9, 2012 11:50 AM (in response to Tracy Rodgers)Petty that Tableau does not seem to know array (vector) constructors.
Thanks.
Dani