--- title: "QQ - How do I select the \"best\" record according to some numeric score?" slug: "qq-how-do-i-select-the-best-record-according-to-some-numeric-score" updated: 2023-03-16T13:46:02Z published: 2023-03-16T13:46:02Z canonical: "docs.datajet.app/qq-how-do-i-select-the-best-record-according-to-some-numeric-score" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # QQ - How do I select the "best" record according to some numeric score? Use HighDiscrete to select the record with the highest score. See [DataSet HotBar - Quick Reference (Function | High Discrete)](https://docs.datajet.app/docs/dataset-hotbar-quick-reference#high-discrete) for details. Note that this method requires a key table - the key table is the PRIMARY table in a PRIMARY -< FOREIGN (ONE to MANY) relationship. For example, to select the record with the highest transaction id for each customer, a transaction (sales) table and customer (individual) table is required: ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1678973968749.png) A key table can be created using any of the following methods: - CreateKeyTable method, - Database tree | Right-click | Advanced | Make Key Table - Engineering | Make Key Table ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1678974077177.png)