2 Replies Latest reply on Jul 16, 2012 1:05 AM by Serge GABRIEL

# Problem with "Sum of Max" and "Sum of Min"

Hello,

I have a problem with one visualization on Tableau (Calculation)

Please find more details and an example on the attached file.

Sheet "Prices MIN/MAX"

I calculate for several components, supplied by different suppliers, the Sum of all cheapest suppliers and the sum of all most expensive suppliers. The problem is when two suppliers have the same price for a component, the sum count 2 times the price in my calculation. How to avoid it???

Kind regards,

Serge

• ###### 1. Re: Problem with "Sum of Max" and "Sum of Min"

Hi,

Attached is one method. A table calc called "Min Price jtd" using IF FIRST()==0 THEN WINDOW_MIN(SUM([Price])) calculates the minimum price, with Compute Using set to Supplier but only returns a result for one row in the partition. Then a "Total Min Price jtd" calc using WINDOW_SUM([Min Price jtd]) totals up all the minimum prices. Two more calcs do the same for the Max price.

Cheers,

Jonathan

• ###### 2. Re: Problem with "Sum of Max" and "Sum of Min"

Thanks Jonathan, it's a perfect solution: