# How to display the last 3 values in a column horizontally

**URL:** <https://forum.inductiveautomation.com/t/how-to-display-the-last-3-values-in-a-column-horizontally/65490>\
**Category:** Ignition\
**Tags:** namedqueries, vision\
**Created:** [October 20, 2022, 8:51pm UTC](https://forum.inductiveautomation.com/t/how-to-display-the-last-3-values-in-a-column-horizontally/65490 "2022-10-20T20:51:25Z")\
**Posts on this page:** 1\
**Showing post:** 7

<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 25, 2022, 12:42pm UTC](https://forum.inductiveautomation.com/t/how-to-display-the-last-3-values-in-a-column-horizontally/65490/7 "2022-10-25T12:42:28Z")

</div>

> [@Brennan\_Joles](#):
>
> Honestly it seems ridiculous that vision doesn't have the option to transpose rows and columns easily or even pull multiple rows into a string.

Well, Vision may not have script transforms built into the binding window, but you can get the effect of that by using `runScript()` or my `objectScript()` in an expression binding. Such a script can perform whatever transpose operation you like. This solution predates Perspective:

> [@Transpose Rows and Columns](https://forum.inductiveautomation.com/t/transpose-rows-and-columns/14308/2):
>
> I have something that could be massaged into what you need. The follow code is designed to take one or more datasets, each with a just a few rows, and flip all the rows into columns. Should be close to what you need: #---------- # Construct a dataset with columns from supplied datasets rows. The column # names from the first dataset become the string values in the first column # of the result. The first argument to the function is a sequence of names # for the dataset arguments. The name s…

You might also find the Pseudo-SQL PIVOT from my `view()` expression function useful.

{ `objectScript()` and `view()` are from my free [Simulation Aids Module](https://inductiveautomation.com/moduleshowcase/module/automation-professionals-llc-simulation-aids). }

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-to-display-the-last-3-values-in-a-column-horizontally/65490)._
