# Select max value in datatype

**URL:** <https://forum.bubble.io/t/select-max-value-in-datatype/230254>\
**Category:** Database\
**Created:** [October 28, 2022, 1:24pm UTC](https://forum.bubble.io/t/select-max-value-in-datatype/230254 "2022-10-28T13:24:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kooxda](https://avatars.discourse-cdn.com/v4/letter/k/f6c823/32.png) [@kooxda](https://forum.bubble.io/u/kooxda)\
**Post date:** [October 28, 2022, 1:24pm UTC](https://forum.bubble.io/t/select-max-value-in-datatype/230254/1 "2022-10-28T13:24:24Z")

</div>

Hi,  
I have a test that people have to take and the result of the test is stored in a datatype called `dataTypeTest` that has 5 fields “fieldQ1”, “fieldQ2”, “fieldQ3”, “fieldQ4” and “fieldUser”. I also have an option set that has a display of Q1, Q2, Q3 and Q4

Example datatype values: 3,4,3,5,Juan  
Example option set values: cook, drive, work, sports

I need to retrieve the highest of the 4 “Q” values to show someone’s strengths.  
I want to tell him in the app: “ **Juan** , your strength is **sports** with a **5** ”

But I can’t seem to figure out how. I don’t mind if it has to be done before the test is saved or after running a backend workflow.

It seemed to me that the best way to do this was to save those 4 numbers into a repeating number group and then order, but then I do not know if the strength is Q1,Q2,Q3 or Q4, I just know that the highest value is 5.

I hope I made myself clear and someone can give me a hand…
