Ok, I will turn on debugging, remove the aggregates. At most so far its been maybe 15 rows? This whole thing is for making purchase orders so its not that many rows.
And good call about the mylist
- I think I did that initially for debugging/to see what was possible, but I obviously don’t need it so I will remove it.
Here are the log results without removing mylist as of now. I open the window the first time it loads quickly, then any subsequent opening is slow.
Results:



Here are the results without the mylist
variable
I see three similar logs
view() execution time 65228 us
view() execution time 3928 us
view() execution time 3598 us
Don’t know why I see three execution times though - perhaps I have some issue where it’s executing three times or is this expected?
I think this is the jython you were referencing -
Message: from system.aggregate import *
_groups = {}
for _r in xrange(_from.rowCount):
parentPartId = _from.getValueAt(_r, 1)
orderedButNotConfirmed = _from.getValueAt(_r, 2)
confirmedByVendor = _from.getValueAt(_r, 3)
receivedByPSI = _from.getValueAt(_r, 4)
billedToPSI = _from.getValueAt(_r, 5)
paidByPSI = _from.getValueAt(_r, 6)
name = _from.getValueAt(_r, 9)
description = _from.getValueAt(_r, 10)
unitcost = _from.getValueAt(_r, 11)
taxable = _from.getValueAt(_r, 12)
taxAmount = _from.getValueAt(_r, 13)
officeLocationName = _from.getValueAt(_r, 15)
ordering = _from.getValueAt(_r, 17)
_groupkey = (parentPartId, ordering,)
if _groupkey in _groups:
_grouprow = _groups[_groupkey]
_grouprow[0].append(parentPartId)
_grouprow[1].append(orderedButNotConfirmed)
_grouprow[2].append(confirmedByVendor)
_grouprow[3].append(receivedByPSI)
_grouprow[4].append(billedToPSI)
_grouprow[5].append(paidByPSI)
_grouprow[6].append(name)
_grouprow[7].append(description)
_grouprow[8].append(unitcost)
_grouprow[9].append(taxable)
_grouprow[10].append(taxAmount)
_grouprow[11].append(officeLocationName)
_grouprow[12].append(ordering)
else:
_groups[_groupkey] = [[parentPartId], [orderedButNotConfirmed], [confirmedByVendor], [receivedByPSI], [billedToPSI], [paidByPSI], [name], [description], [unitcost], [taxable], [taxAmount], [officeLocationName], [ordering]]
_rows =
for _grouprow in _groups.itervalues():
parentPartId, orderedButNotConfirmed, confirmedByVendor, receivedByPSI, billedToPSI, paidByPSI, name, description, unitcost, taxable, taxAmount, officeLocationName, ordering, = tuple(_grouprow)
Ordered = system.aggregate.sum(orderedButNotConfirmed)
Confirmed = system.aggregate.sum(confirmedByVendor)
Received = system.aggregate.sum(receivedByPSI)
Billed = system.aggregate.sum(billedToPSI)
Paid = system.aggregate.sum(paidByPSI)
parentPartId = parentPartId[0]
Name = name[0]
Description = description[0]
Quantity = system.aggregate.count(ordering)
Cost = unitcost[0]
TotalCost = system.aggregate.sum(unitcost)
Taxable = all(taxable)
TaxAmount = system.aggregate.sum(taxAmount)
Location = new_dtype.dataset.allSameOrMixed(officeLocationName)
ordering = ordering[0]
_orderkey = (ordering,)
_rows.append([_orderkey, [Ordered, Confirmed, Received, Billed, Paid, parentPartId, Name, Description, Quantity, Cost, TotalCost, Taxable, TaxAmount, Location, ordering]])
_rows.sort()
_rows = [x[1] for x in _rows]
__retv = system.dataset.toDataSet(_resultColumns, _rows)
Time: Fri Apr 29 9:11:21AM
Severity: DEBUG
Logger: com.automation_pros.simaids.View