Returning the value associated with a max value in a column

Hey y’all —

I’ve got a table of orders: product, date, quantity, etc. And I’m trying to return the quantity for the most recent order for each product in my product list table.

I’m new to coda’s formula structure and can’t figure out how to return the quantity (I was able to grab the latest date for each product).

Any suggestions?

Thanks!

Hi Gus,

Welcome to Coda! Hope you will find it useful.

Could you provide an example of how you want to see the result? I assume it a view of the basic table?

In the attached example I have created a column that finds the Max(), and then created a formula based filter to show only the row where the value in the source column is equal to the value in the Max column.
(This has been changed to reflect the second answer in the thread)
thisRow.colNumber=thisRow.colmax in the example below:

So I’m not sure how to embed a doc like you did but here’s a screenshot of what I’d like it to look like:

Obviously I just hard coded the values but I’d like “most recent order” and “most recent quantity” to be pulled from the Orders table

Does that help to clarify what I’m trying to do?

Thanks Gus, it is clear.

I have made changes to the doc: There is another column towards the right of the table - the view now uses that value to filter.

To embed, do the following:
Click on Share, top right of the screen. The click on Embed tab, click on copy embed button, and paste where you would like it to appear.

image

Regards
Piet

1 Like

@Piet_Strydom I am trying to take a look at the table you shared so I can understand how this works. I’m trying to figure out how to normalize data, and in Excel/Sheets you can easily write a formula to find the max of a column. I think I can achieve this using your results, but I can’t see the sheet you embedded.

HI Allen

Here is a link directly to the page in that document.

Let me know if you still have problems.

Regards
P

1 Like

If you’re looking for max values, why would Product 2 be 5? Shouldn’t it be 11?

@Piet_Strydom thanks so much! This was exactly what I needed.

1 Like

@Bill_French
He was looking for the most recent, not max.

1 Like