# Dataset Row and Column count

**URL:** <https://forum.inductiveautomation.com/t/dataset-row-and-column-count/12237>\
**Category:** Ignition\
**Created:** [October 14, 2016, 3:44pm UTC](https://forum.inductiveautomation.com/t/dataset-row-and-column-count/12237 "2016-10-14T15:44:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [October 14, 2016, 3:44pm UTC](https://forum.inductiveautomation.com/t/dataset-row-and-column-count/12237/1 "2016-10-14T15:44:17Z")

</div>

Hi everyone, I was wondering if there is a way to check on the number of rows of a dataset using Expression language. I know you can do it with scripting. I check order numbers I get from PLC with a 3 tables to come up with the actual part number and sometimes one order number has two part numbers ( left and right). I want to use this in my if statement so basically if there is only one row then give me {Dataset}[0,0] if more than one row then give me {Dataset}[0,0] +{Dataset}[1,0].  
Right now my solution to this issue is to use another Query tag to get the number of rows of my dataset and then use that tag in my expression code. figured to check if there is a better way?  
Thank you.

---

<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 14, 2016, 4:50pm UTC](https://forum.inductiveautomation.com/t/dataset-row-and-column-count/12237/2 "2016-10-14T16:50:06Z")

</div>

My swiss army knife to the rescue! Use this expression after installing [Simulation Aids](https://www.automation-pros.com/modulesales.html):`objectScript("''.join([args[0].getValueAt(r, 0) for r in range(args[0].rowCount)])",
  {Root Container.myCustomDatasetProp})`

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [October 14, 2016, 6:30pm UTC](https://forum.inductiveautomation.com/t/dataset-row-and-column-count/12237/3 "2016-10-14T18:30:52Z")

</div>

You can use

```auto
len({MyDataSetTag})
```

Or

Are you concatenating 2 strings?

```auto
groupConcat({MyDataSet},0,",")
```

Or adding?

```auto
sum({MyDataSetInt},0)
```

---

<div class="post-metadata">

**Author:** ![Mr.K001](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@Mr.K001](https://forum.inductiveautomation.com/u/Mr.K001)\
**Post date:** [October 14, 2016, 8:28pm UTC](https://forum.inductiveautomation.com/t/dataset-row-and-column-count/12237/4 "2016-10-14T20:28:42Z")

</div>

jpark and pturmel Thank you both for your replies but jpark’s solution was exactly what I was looking for since I was looking for a simple Expression code to get it done. Thanks again both of you. ![:thumb_right:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/2026e28c0c425034352c1b75807edf956adc75f4.gif ":thumb\_right:")
