# Reporting module - Alarm journal query - sort order

**URL:** <https://forum.inductiveautomation.com/t/reporting-module-alarm-journal-query-sort-order/37656>\
**Category:** Ignition\
**Created:** [August 12, 2020, 3:13pm UTC](https://forum.inductiveautomation.com/t/reporting-module-alarm-journal-query-sort-order/37656 "2020-08-12T15:13:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![greg.krueger](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@greg.krueger](https://forum.inductiveautomation.com/u/greg.krueger)\
**Post date:** [August 12, 2020, 3:13pm UTC](https://forum.inductiveautomation.com/t/reporting-module-alarm-journal-query-sort-order/37656/1 "2020-08-12T15:13:15Z")

</div>

We’re using an alarm journal query data source in a report and are looking to see if there is a way to change the sort order of the results that are returned. We couldn’t see anything obvious in the query config properties, so wanted to see if anyone knows if this is configurable, and if so how to do it, and if not are there other ways to sort the data at the page config on the report - we couldn’t see a way to do that either.

Any assistance appreciated,

-Greg

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [August 12, 2020, 3:19pm UTC](https://forum.inductiveautomation.com/t/reporting-module-alarm-journal-query-sort-order/37656/2 "2020-08-12T15:19:26Z")

</div>

Use a script datasource after the alarm journal query data source and you can rearrange the data to your heart’s content.

---

<div class="post-metadata">

**Author:** ![greg.krueger](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@greg.krueger](https://forum.inductiveautomation.com/u/greg.krueger)\
**Post date:** [August 13, 2020, 2:27pm UTC](https://forum.inductiveautomation.com/t/reporting-module-alarm-journal-query-sort-order/37656/3 "2020-08-13T14:27:48Z")

</div>

Kathy,

Thanks for the tip. We ended up using a standard SQL query instead…we have a system with auto-acknowledged alarms and if we had “Active” filter checked in the Alarm journal query but not “Acknowledge” (we only want to see when alarms went active) then no alarms would show up at all. Looks like the alarm journal query is using the eventflags in addition to the eventtype, so even if eventtype is 0 for active, if the eventflag has the ack bit set then the query rejects it. For our query we just used the eventtype =0 and that gave us what we wanted and then we could just add the order by to that for sorting.
