Report Table Formatting

Okay, that’s what I thought.

When @PGriffith posted the script he used the def updateData(data, sample) signature to show that what was following should go in the script source.

Delete Line 2 from the script, and then move the rest of the code back one indentation, and it should work as expected.

1 Like

Ahhh, okay. That makes way more sense…

Now I am getting the following error:

Insure that the the string you used here: data['startTimeQuery'] matches exactly what you used for the Data Key in the query data source. I can’t think of any reason it wouldn’t be a dataset at the moment.

@lrose Yup, it is the same. Below is a screen grab of the query

Okay, brushed up on my report module. :laughing:

try this:

queryData = system.dataset.toPyDataSet(data["startTimeQuery"].getCoreResults())
1 Like

@lrose Making some progress now. That error cleared and we are now onto another one! lol

Line 12 is:

for setOfValues in chunker(queryData[0], 4):

The assumption of the script is that the Query always returns 1 row. We need to insure that queryData is not empty before trying to do work on it, or insure that 1 row is always returned by the query.

You can handle this in the query, but probably simpler just to account for it in the script.

if queryData.rowCount:
    for setOfValues in chunker(queryData[0], 4):

Don’t copy and paste that, instead type it in so that the indentation matches, also be sure to indent everything following.

This will mean that if the query source returns nothing then you will not have a piviotedData Key either.

1 Like

Thanks for working through it @lrose; I came up with the script in a text editor so I figured there’d be some integration woes.

1 Like