# Filtering Table

**URL:** <https://forum.inductiveautomation.com/t/filtering-table/97295>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [October 16, 2024, 7:54am UTC](https://forum.inductiveautomation.com/t/filtering-table/97295 "2024-10-16T07:54:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robbie.Wozencroft](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@Robbie.Wozencroft](https://forum.inductiveautomation.com/u/Robbie.Wozencroft)\
**Post date:** [October 16, 2024, 7:54am UTC](https://forum.inductiveautomation.com/t/filtering-table/97295/1 "2024-10-16T07:54:24Z")

</div>

I'm hoping this is a silly question and an easy fix, but when i'm filtering my table by t\_stamp and selecting most current date why does it not save on the Ignition client?

my current table's first selected row is the first entry into the db, but i would like it to show the last entry into the db.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/0/306f5e5cbdfa4e904f58f539c2508e0816ac57e9.png) ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/1/c18146962ea44d9028229887c558b77cc3b25613.png)

Help would be appreciated thanks.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 16, 2024, 11:45am UTC](https://forum.inductiveautomation.com/t/filtering-table/97295/2 "2024-10-16T11:45:46Z")

</div>

Filtering and ordering on a table via the header are **user** operations, not **designer** operations. The table always starts with the order of the supplied dataset. If you wish that to always be a certain order, arrange that in the query binding that supplies it.

(Or use an expression or script to reorder, perhaps using my [orderBy()](https://www.automation-pros.com/toolkit/doc/iteration.html#orderby) expression function.)

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [October 16, 2024, 11:55am UTC](https://forum.inductiveautomation.com/t/filtering-table/97295/3 "2024-10-16T11:55:16Z")

</div>

If u don´t want change the query you may try

In your script:

```python

table = event.source.parent.getChild("YourTable")

# Set the first row as selected after data is loaded
if len(table.props.data) > 0:
    table.props.selection.data = [{"row": 0}]

```

---

<div class="post-metadata">

**Author:** ![Robbie.Wozencroft](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@Robbie.Wozencroft](https://forum.inductiveautomation.com/u/Robbie.Wozencroft)\
**Post date:** [October 16, 2024, 1:01pm UTC](https://forum.inductiveautomation.com/t/filtering-table/97295/4 "2024-10-16T13:01:00Z")

</div>

Thanks @pturmel didn't think to change the query, sorted now.

---

<div class="post-metadata">

**Author:** ![Robbie.Wozencroft](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@Robbie.Wozencroft](https://forum.inductiveautomation.com/u/Robbie.Wozencroft)\
**Post date:** [October 16, 2024, 1:01pm UTC](https://forum.inductiveautomation.com/t/filtering-table/97295/5 "2024-10-16T13:01:49Z")

</div>

Thanks @Alejandro_Alaco cool solution didn't know i could do this.
