How to get Report Keys Calculations values from DataMap in Schedule Run Script

Hi everyone,

I’m trying to access the Data Source Key calculation values (such as Total, Min, Max, etc.) that are automatically generated when a report is run via Schedule → Run Script, using the dataMap dictionary.

For regular dataset values, I can access individual columns like this:

dataMap['datKey'][0].getKeyValue("columnName")

However, I can’t figure out how to access the calculation values (those created by “Show Calculations” on the data source). I haven’t been able to find any documentation or examples in the manual that explain how these calculation results are exposed in dataMap.

Is there a supported way to access these calculation values from a report script?

Thanks in advance.

These extra keys (especially the Running ones) only exist at "runtime", when the report is being generated; they're calculated by the reporting engine on the fly, and I believe "lazy" - they are only evaluated if they're actually needed. Putting the basic keys into the data map would be possible, but is not currently supported; no one has ever asked us for it as far as I know.

You can always use the system.math functions to run the same calculations on your dataset manually:

I did the same thing and calculated the sum of the tag_hostory data source but interestingly when the size number of history query is more 500 I get different values from one the report calculated but for values less 200 both get same exact values!!!

It seems when the size number of return query increase the interpolation is different and cause this kind of error.