# Sql pareto for column values per row help request

**URL:** <https://forum.inductiveautomation.com/t/sql-pareto-for-column-values-per-row-help-request/59119>\
**Category:** Ignition\
**Created:** [May 2, 2022, 2:51pm UTC](https://forum.inductiveautomation.com/t/sql-pareto-for-column-values-per-row-help-request/59119 "2022-05-02T14:51:11Z")\
**Posts on this page:** 1\
**Showing post:** 39

<div class="post-metadata">

**Author:** ![zacharyw.larson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacharyw.larson/32/23749_2.png) [@zacharyw.larson](https://forum.inductiveautomation.com/u/zacharyw.larson)\
**Post date:** [May 4, 2022, 6:05pm UTC](https://forum.inductiveautomation.com/t/sql-pareto-for-column-values-per-row-help-request/59119/39 "2022-05-04T18:05:27Z")

</div>

I have to add net and defects to the table, then also line and a percentage of defects per net

However, I am not getting an error, yet it is not working.

time is going too long on the script execute, says interrupt on the button

I defined reasonHeaders and suffixHeaders.  
reasonHeaders=[‘thisReason’,…‘nReason’]  
suffixHeaders=[‘thisNet’,…‘nCalculation’]

```auto
for row in dataIn:
	data=[row[colName] for colName in reasonHeaders]	
	pareto = [[x, y] for y, x in reversed(sorted(zip(data, reasonHeaders)))]

#print pareto

for row in dataIn:
	data2=[row[colName] for colName in suffixHeaders]	
	testThis =[[x,y] for y, x in zip(data2,suffixHeaders)]
	
print testThis

for row in pareto:
	for col in pareto:
		pareto.append(testThis)
	
print '-----'
	
print pareto

```

I thought if I got them both in lists, I could do something like:  
for column append

keeps timing out, I am reviewing append function

---

_[View the full topic](https://forum.inductiveautomation.com/t/sql-pareto-for-column-values-per-row-help-request/59119)._
