Forum Discussion

MaxAllen's avatar
MaxAllen
Qrew Cadet
6 years ago

Quickbase Summary Field - Most Common Response

Is there a way of creating a Summary field that shows the most common response to a certain field on the child table.

For example say I have a parent table, Days; and a child table, Orders. And I want to report the best selling product on each day.

Any help much appreciated!
  • Assuming you have a child table to orders like "Order items" for each record on each order (which would contain something like the qty sold and $)??

    If that's the case and all you want to know is the top seller each day, take a look at the diagram I made below. If you want to 'rank' the items for each day, there may be some way to do this natively but it's making my head spin to the point that I think this is a rare occasion where writing javascript would be faster...

    You may need a little code to get your data into the below structure anyway (unless someone can chime in with a native solution).

    Assuming you have a structure of Days->Orders->Items, you'd need some way to create records in this table called "Item Sales" which would be a deduplicated list of all items sold in a particular day (across all orders). Once you do that, the below is pretty straightforward; and a valuable technique in general for isolating the max, min, etc.. values in a particular set of data.



    I know I left a major piece of this unsolved (getting the data into the above schema) but perhaps try pulling a days worth of item sales, deduplicaing it, and trying the above to see if that's what you need. I'd be  happy to walk you through how to do that in a more automated way if you'd like.

    Charlie