# SPC: Attribute name in control limits script

**URL:** <https://forum.inductiveautomation.com/t/spc-attribute-name-in-control-limits-script/9323>\
**Category:** 3rd Party Modules\
**Created:** [November 12, 2014, 1:49pm UTC](https://forum.inductiveautomation.com/t/spc-attribute-name-in-control-limits-script/9323 "2014-11-12T13:49:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michal](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@Michal](https://forum.inductiveautomation.com/u/Michal)\
**Post date:** [November 12, 2014, 1:49pm UTC](https://forum.inductiveautomation.com/t/spc-attribute-name-in-control-limits-script/9323/1 "2014-11-12T13:49:40Z")

</div>

I would like to set control limits based on the attribute name in the Control Limits calculation script (designer, enterprise level Quality configuration). The idea is to have a custom database table with product code, attribute and fixed values for limits (UCL, USL, …). These limits should be synchronized across the SPC charts.

So, I would like to put a simple query into the control limits calculation (seems as a best place and then just use the default calculate popup of SPC charts). I can get the product code (from the sample - id is part of the SPC data sent to this script in the event). But I can’t find a way how to get the AttributeName. I know that it’s one of the parameters of the: `system.quality.spc.controllimit.calcControlLimitValue ` which I guess is just the manual way how to call the calculation. So, I think it should accessible somehow.

Is there a way how to get this information in the script? Is my idea correct?

Thanks,

Michal
