In the AM I'm going to try something like this:
{
{% set myDataSet = "myTableID" %}
{% set myTimeStop = 5.0 %}
{% set runningTotal = namespace(val=0.0) %}
"to": "{{myDataSet}}",
"data":[
{% set i = 0 %}
{% while runningTotal.val <= myTimeStop and i < a.json.total_records %}
{% set row = a.json.data %}
{% set remainingTime = myTimeStop - runningTotal.val %}
{% set currentValue = row['33'].value if row['33'].value <= remainingTime else remainingTime %}
{% set runningTotal.val = runningTotal.val + currentValue %}
{
"6":{
"value": "{{row['36'].value}}"
},
"7":{
"value": "{{row['8'].value}}"
},
"8":{
"value": "{{row['13'].value}}"
},
"9":{
"value": "{{currentValue}}"
},
"10":{
"value": "{{runningTotal.val}}"
}
}
{% set i = i + 1 %}
{% if loop.last == false and runningTotal.val <= myTimeStop %},{% endif %}
{%- endwhile %}
]
}
------------------------------
Dwight Munson
------------------------------