# Chart Dataset Expression, last row

**URL:** <https://forum.inductiveautomation.com/t/chart-dataset-expression-last-row/4035>\
**Category:** Ignition\
**Created:** [February 21, 2012, 2:10pm UTC](https://forum.inductiveautomation.com/t/chart-dataset-expression-last-row/4035 "2012-02-21T14:10:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![quper](https://avatars.discourse-cdn.com/v4/letter/q/aeb1de/32.png) [@quper](https://forum.inductiveautomation.com/u/quper)\
**Post date:** [February 21, 2012, 2:10pm UTC](https://forum.inductiveautomation.com/t/chart-dataset-expression-last-row/4035/1 "2012-02-21T14:10:47Z")

</div>

Hi,

I have classic chart with dataset.  
I would like Numeric Label to show value of the last row and column "Test History"in this dataset.

I tried to bind Numeric Label Value to this Expression:

```auto
{Root Container.Chart.Chart.TestHistory}[{Root Container.Chart.Chart.TestHistory.rowCount}, "Test History"]
```

But I get an Error: “Path ‘Root Container.Chart.Chart.TestHistory’ not defined”.

But if I use such Expression:

```auto
{Root Container.Chart.Chart.TestHistory}[1, "Test History"]
```

It works.

The question is, how to get last row from Chart’s Dataset?

Thanks!

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [February 22, 2012, 9:56pm UTC](https://forum.inductiveautomation.com/t/chart-dataset-expression-last-row/4035/2 "2012-02-22T21:56:29Z")

</div>

Right, the chart doesn’t have a rowCount property. You need to do the following:`try({Root Container.Chart.Chart.TestHistory}[len({Root Container.Chart.Chart.TestHistory.Data})-1, "Test History"], 0)`Also, make sure to wrap it in a try function when no rows exist in the dataset.

---

<div class="post-metadata">

**Author:** ![derek.neilson](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@derek.neilson](https://forum.inductiveautomation.com/u/derek.neilson)\
**Post date:** [April 7, 2019, 10:35pm UTC](https://forum.inductiveautomation.com/t/chart-dataset-expression-last-row/4035/3 "2019-04-07T22:35:27Z")

</div>

Hi,

Does this still work. I am using 7.9.6 and my datasets don’t have a “Data” property either?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [April 9, 2019, 2:34pm UTC](https://forum.inductiveautomation.com/t/chart-dataset-expression-last-row/4035/4 "2019-04-09T14:34:41Z")

</div>

Yes this type of expression still works. It will work for any dataset. Can you provide more context or an example of what is not working?
