# Use MAX in Report Detail Row

**URL:** <https://forum.inductiveautomation.com/t/use-max-in-report-detail-row/88260>\
**Category:** Ignition\
**Tags:** reporting\
**Created:** [April 2, 2024, 9:10pm UTC](https://forum.inductiveautomation.com/t/use-max-in-report-detail-row/88260 "2024-04-02T21:10:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_Garman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin_garman/32/48695_2.png) [@Kevin\_Garman](https://forum.inductiveautomation.com/u/Kevin_Garman)\
**Post date:** [April 2, 2024, 9:10pm UTC](https://forum.inductiveautomation.com/t/use-max-in-report-detail-row/88260/1 "2024-04-02T21:10:11Z")

</div>

In a report, I'd like to compare the current detail row value against the max value for the column. It seems that max is \<N/A\> in detail rows. Any suggestions on how I can indicate which row is has the max value?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 2, 2024, 9:12pm UTC](https://forum.inductiveautomation.com/t/use-max-in-report-detail-row/88260/2 "2024-04-02T21:12:46Z")

</div>

Reporting is a separate module to Perspective so the problem isn't a Perspective one. I removed the tag and I'll delete this post later.

---

<div class="post-metadata">

**Author:** ![amy.sudibyo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amy.sudibyo/32/38659_2.png) [@amy.sudibyo](https://forum.inductiveautomation.com/u/amy.sudibyo)\
**Post date:** [April 3, 2024, 4:59am UTC](https://forum.inductiveautomation.com/t/use-max-in-report-detail-row/88260/3 "2024-04-03T04:59:03Z")

</div>

I'm assuming you're using the 'max' aggregate key in the report table? As far as I know that only works in the summary section at the bottom of the table, not in a detail row.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/b/bb36bf51699a6ec30810af2020ece133c3cb0ba3.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/7/278395299a31b46c90947a3b34162cd1419d73a5.png)

If you want to know the row number that contains the max value, you might need to add an additional script data source and put some logic there to find this out and add it to your dataset.

---

<div class="post-metadata">

**Author:** ![Kevin\_Garman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin_garman/32/48695_2.png) [@Kevin\_Garman](https://forum.inductiveautomation.com/u/Kevin_Garman)\
**Post date:** [April 4, 2024, 1:25pm UTC](https://forum.inductiveautomation.com/t/use-max-in-report-detail-row/88260/4 "2024-04-04T13:25:29Z")

</div>

Ya, that's what I was afraid of...thanks.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 4, 2024, 2:41pm UTC](https://forum.inductiveautomation.com/t/use-max-in-report-detail-row/88260/5 "2024-04-04T14:41:10Z")

</div>

Get the SQL query to do that donkey work for you.  
Share your query and we'll figure out a solution.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 4, 2024, 5:21pm UTC](https://forum.inductiveautomation.com/t/use-max-in-report-detail-row/88260/6 "2024-04-04T17:21:28Z")

</div>

Here's an example I created for you on SQL Fiddle.

> **[Add a comment to the row with the maximum value](https://sqlfiddle.com/mysql/online-compiler?id=030f3ffa-bad4-4189-900c-f760cf8df15c)**
>
> Modify to suit.
