Prevent summing when field dates are exactly the same

How can I prevent summing fields where date (field D) is exactly the same? I have stock data that comes in that is distinct, but the date is exactly the same on some rows (up to the millisecond). In this case, I don’t want to sum the price (field P), but instead just select one of the entries, or somehow select the greater price (field P) where the dates are the exact same. See the screenshot below, metabase sums the price (field P), and thus miscalculates the price at that exact date (field D).

Currently you’d need to either:

  1. aggregation and group the data in the query, thne you can pick whichever aggregation function you want (probably min, max, or average)
  2. use a scatter plot

Hi Tom,

Thanks for the reply. Can you provide information how to “aggregation and group the data in the query, thne you can pick whichever aggregation function you want (probably min, max, or average)”.

Thanks.

I figured it out. Very cool.