# Powerchart data source

**URL:** <https://forum.inductiveautomation.com/t/powerchart-data-source/64120>\
**Category:** Ignition\
**Tags:** ignition81, database, perspective\
**Created:** [September 15, 2022, 3:31pm UTC](https://forum.inductiveautomation.com/t/powerchart-data-source/64120 "2022-09-15T15:31:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NII](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nii/32/12920_2.png) [@NII](https://forum.inductiveautomation.com/u/NII)\
**Post date:** [September 15, 2022, 3:31pm UTC](https://forum.inductiveautomation.com/t/powerchart-data-source/64120/1 "2022-09-15T15:31:50Z")

</div>

DB Table Historian Provider doc shows an example of filtering below:

> Blockquote  
> `histprov:DB Table_Historian:` `/` `table:machine_values:` `/` `column:process_value:` `/` `timestamp:time:` `/` `keycolumn:machine_id:` `/` `keyvalue:` `1`

how can I use a variable as the value of the keyvalue, for exampe from a view parameter?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [September 15, 2022, 3:46pm UTC](https://forum.inductiveautomation.com/t/powerchart-data-source/64120/2 "2022-09-15T15:46:08Z")

</div>

Well, that depends, will the number of pens be fixed? What exactly are you trying to accomplish other than filtering?

In theory, if say you were ever only going to have one pen, then you could put a binding on `props.pens[0].data.source` and then use an expression to build the string.

However, this can also be done with an expression structure or scripting. The exact approach will depend heavily on how dynamic you are trying to make the view. For instance I have scripting that allows us to load saved charts from a DB, that requires dynamically loading pens into the chart.
