# View function,PseudoSQL

**URL:** <https://forum.inductiveautomation.com/t/view-function-pseudosql/84840>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [January 27, 2024, 12:39am UTC](https://forum.inductiveautomation.com/t/view-function-pseudosql/84840 "2024-01-27T00:39:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![samer\_samy](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/samer_samy/32/52910_2.png) [@samer\_samy](https://forum.inductiveautomation.com/u/samer_samy)\
**Post date:** [January 27, 2024, 12:39am UTC](https://forum.inductiveautomation.com/t/view-function-pseudosql/84840/1 "2024-01-27T00:39:12Z")

</div>

Dears,  
I installed recently Free Integration Toolkit for Ignition to use (view) function that helps me a lot to use SQL with my datasets.

```auto
VIEW("SELECT LOT,count(UOMQTY)As Total group by LOT order by count(UOMQTY) ",{value})

```

here I want to order in descending order ,but do not know how to do as order by xxx desc is not accepted.

I also need support in using view function to write more advanced queries.

Regards,

---

<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 27, 2024, 1:25am UTC](https://forum.inductiveautomation.com/t/view-function-pseudosql/84840/2 "2024-01-27T01:25:29Z")

</div>

Unfortunately, the `view()` function cannot do descending order. Instead, negate a numeric expression, or convert dates/times to numeric (millis) and negate that.

Consider switching to the iterator functions, like `where()` and `orderBy()`, as they can achieve all the core functions of `view()` (except pivots) with substantially improved performance. And the `orderBy()` function does allow `decending()` nested in its keys.

---

<div class="post-metadata">

**Author:** ![samer\_samy](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/samer_samy/32/52910_2.png) [@samer\_samy](https://forum.inductiveautomation.com/u/samer_samy)\
**Post date:** [January 27, 2024, 8:06am UTC](https://forum.inductiveautomation.com/t/view-function-pseudosql/84840/3 "2024-01-27T08:06:48Z")

</div>

Thanks pturmel,I fixed the order by multiply by -1 ,So now where can I find examples for view and where functions, as documentation is not enough.  
as you see here , no explanation of Where function [Expression Functions - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Expression+Functions)  
🥲

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 27, 2024, 8:54am UTC](https://forum.inductiveautomation.com/t/view-function-pseudosql/84840/4 "2024-01-27T08:54:45Z")

</div>

Of course not, they are not built-in functions, they're part of Phil's integration toolkit.

You'll find the doc here:  
[https://www.automation-pros.com/toolkit/doc/index.html](https://www.automation-pros.com/toolkit/doc/index.html)
