# Alarm status sort by time is not the same as active time?

**URL:** <https://forum.inductiveautomation.com/t/alarm-status-sort-by-time-is-not-the-same-as-active-time/16808>\
**Category:** Ignition\
**Created:** [January 30, 2018, 6:27pm UTC](https://forum.inductiveautomation.com/t/alarm-status-sort-by-time-is-not-the-same-as-active-time/16808 "2018-01-30T18:27:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![joeyjojoshabadu](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@joeyjojoshabadu](https://forum.inductiveautomation.com/u/joeyjojoshabadu)\
**Post date:** [January 30, 2018, 6:27pm UTC](https://forum.inductiveautomation.com/t/alarm-status-sort-by-time-is-not-the-same-as-active-time/16808/1 "2018-01-30T18:27:38Z")

</div>

I have an alarm status table set to sort by time, but as you can see there are some entries which are out of order:

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/f/f6554d1eb944e89874e8e29313db4c99d06303cc.png)

If I click on the “Active time” in the header bar twice, I get the sort order I expected when sorting by time:

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/b4d620c1457e1235584c268683f733a273ec2cfa.png)

How can I make the alarm status table sort by active time when it is displayed?

---

<div class="post-metadata">

**Author:** ![jonathan.taylor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jonathan.taylor/32/4048_2.png) [@jonathan.taylor](https://forum.inductiveautomation.com/u/jonathan.taylor)\
**Post date:** [January 31, 2018, 8:49am UTC](https://forum.inductiveautomation.com/t/alarm-status-sort-by-time-is-not-the-same-as-active-time/16808/2 "2018-01-31T08:49:59Z")

</div>

I may be wrong, but I thought it was as simple as clicking run in the designer, sorting it by active time, then saving and publishing the window?

---

<div class="post-metadata">

**Author:** ![joeyjojoshabadu](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@joeyjojoshabadu](https://forum.inductiveautomation.com/u/joeyjojoshabadu)\
**Post date:** [January 31, 2018, 5:26pm UTC](https://forum.inductiveautomation.com/t/alarm-status-sort-by-time-is-not-the-same-as-active-time/16808/3 "2018-01-31T17:26:12Z")

</div>

After going that and then going to the published window it is as in my first screenshot not the second. items are still out of order.

There must be a programmatic way to do the same thing as clicking on active time in the header bar?

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [January 31, 2018, 6:55pm UTC](https://forum.inductiveautomation.com/t/alarm-status-sort-by-time-is-not-the-same-as-active-time/16808/4 "2018-01-31T18:55:03Z")

</div>

We had the same issue and put this in the FilterAlarm script on the alarm status control.

> table=self.getComponent(0).getComponent(0).getComponent(1).getComponent(0).getComponent(0).getComponent(0)  
> table.sortColumn(6,True,False)  
> return True

---

<div class="post-metadata">

**Author:** ![Faisal.Shibli](https://avatars.discourse-cdn.com/v4/letter/f/90db22/32.png) [@Faisal.Shibli](https://forum.inductiveautomation.com/u/Faisal.Shibli)\
**Post date:** [October 17, 2019, 5:09pm UTC](https://forum.inductiveautomation.com/t/alarm-status-sort-by-time-is-not-the-same-as-active-time/16808/5 "2019-10-17T17:09:21Z")

</div>

Could you please provide a bit more details as to what this “.getComponent(0)” and ".getComponent(1) is?

From what I gathered that each getComponent is associated to the column. Since you have 6 columns and as a result you used 6 getComponents.

Thanks for your help in advance MMaynardUSG

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [October 17, 2019, 5:28pm UTC](https://forum.inductiveautomation.com/t/alarm-status-sort-by-time-is-not-the-same-as-active-time/16808/6 "2019-10-17T17:28:29Z")

</div>

No, Each component is a layer in the controls to get down to the underlying table.

---

<div class="post-metadata">

**Author:** ![Henk](https://avatars.discourse-cdn.com/v4/letter/h/b5ac83/32.png) [@Henk](https://forum.inductiveautomation.com/u/Henk)\
**Post date:** [November 8, 2019, 9:15am UTC](https://forum.inductiveautomation.com/t/alarm-status-sort-by-time-is-not-the-same-as-active-time/16808/7 "2019-11-08T09:15:52Z")

</div>

The script works, but:  
The sorting functionality by clicking on the table header will be overwritten by this function.
