# Perspective Table Not Sorting On Number

**URL:** <https://forum.inductiveautomation.com/t/perspective-table-not-sorting-on-number/84974>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [January 30, 2024, 6:36pm UTC](https://forum.inductiveautomation.com/t/perspective-table-not-sorting-on-number/84974 "2024-01-30T18:36:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![csjohnson](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@csjohnson](https://forum.inductiveautomation.com/u/csjohnson)\
**Post date:** [January 30, 2024, 6:36pm UTC](https://forum.inductiveautomation.com/t/perspective-table-not-sorting-on-number/84974/1 "2024-01-30T18:36:14Z")

</div>

Ignition v8.1.35  
Perspective

I have a table bound to a named query that returns a list of orders. I have a Priority column which I would like to sort.  
In the designer, I only have the Priority column selected as `sortable` and also have `sort` as ascending. Following the advice from other posts, I left the `numberFormat` to `none`.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/6/765271aae91e59a4998c35421824c9e605b5b2d9.png)

In the designer, the table is sorted correctly. I can also change the `sort` property and the table will reflect the change in preview mode.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/8/d87166ae01850620d76ea40b038cf345479043dd.png)

However, when I open the view in browser. I get this. Notice that the sort arrow is not selected.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/f/8f5fcb25575e73234f1b58bed124ca7290369b93.png)

No matter what I set the column's `sort` property to, the browser view does not change.  
I have tried setting `sortOrder`, but that does not help.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/3/1345758f1ac708f2b181a0d4cc11d7ea0338de8c.png)

The only way for the browser view to appear sorted is to add  
`ORDER BY [Priority] ASC`  
to the named query.

This works, but my expectation is that I should be able to configure the table columns to sort.

---

<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:** [January 30, 2024, 6:41pm UTC](https://forum.inductiveautomation.com/t/perspective-table-not-sorting-on-number/84974/2 "2024-01-30T18:41:46Z")

</div>

> [@csjohnson](#):
>
> my expectation

The `sortable` property merely **allows** sorting. Presort your data as you are for the component's initial condition.

---

<div class="post-metadata">

**Author:** ![csjohnson](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@csjohnson](https://forum.inductiveautomation.com/u/csjohnson)\
**Post date:** [January 30, 2024, 6:43pm UTC](https://forum.inductiveautomation.com/t/perspective-table-not-sorting-on-number/84974/3 "2024-01-30T18:43:08Z")

</div>

Thank you for the assurance, @pturmel.

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [August 30, 2025, 12:12am UTC](https://forum.inductiveautomation.com/t/perspective-table-not-sorting-on-number/84974/4 "2025-08-30T00:12:29Z")

</div>

What if it is not practical to pre-sort the generated dataset?

Is there a way to fire off a similar event to a user clicking a column to sort it?

I don’t want my table to be pre-loaded with data (lots of rows) and I prefer to fire an update (manually or on page load) to refresh the data source.

But doing so means I lose the pre-sorted column. I’ve also set the required column properties to enable sort and set sortOrder but that only seems to work if you have data in the table already, not when its updated later.

---

<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:** [August 30, 2025, 1:47am UTC](https://forum.inductiveautomation.com/t/perspective-table-not-sorting-on-number/84974/5 "2025-08-30T01:47:26Z")

</div>

> [@richardNZ15](#):
>
> not practical to pre-sort the generated dataset?

Why? There are numerous binding and expression and transform options. (Particularly in my Integration Toolkit.)

You have to plan around what is possible with your chosen component(s). As you have admitted, you cannot apply table sort settings before there is data, or when data changes. With that constraint, pre-sorting is the **only** option. 🤷‍♂️

(Probably. Change events might help.)

Make a feature request. Presort until that is implemented.

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [August 30, 2025, 2:14am UTC](https://forum.inductiveautomation.com/t/perspective-table-not-sorting-on-number/84974/6 "2025-08-30T02:14:32Z")

</div>

Sorry somehow I missed this (which will work just fine):

> **[system.dataset.sort | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.3/appendix/scripting-functions/system-dataset/system-dataset-sort)**
>
> Sorts a dataset and returns the sorted dataset.

---

<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:** [August 30, 2025, 4:17pm UTC](https://forum.inductiveautomation.com/t/perspective-table-not-sorting-on-number/84974/7 "2025-08-30T16:17:06Z")

</div>

> [@richardNZ15](#):
>
> missed this

If you need expression performance, or more ordering options, consider my Toolkit's [orderBy()](https://www.automation-pros.com/toolkit/doc/iteration.html#orderby) and/or [system.dataset.orderBy()](https://www.automation-pros.com/toolkit/doc/datasets.html#orderby) functions.
