[Bug] Issue with Reporting Data Keys

I'm not sure if this is intended behavior, but when I have data keys that start with a number, even when that number is in string format, for example:

data["2023"] or data[key] where key = str(system.date.getYear(system.date.now()))

The data is available in the XML preview, but when used on a component everything returns as <N/A>

This is the script I was using, trying to make unique datasets for each year with a key that is the string value of the year:

	currentYear = system.date.getYear(system.date.now())
	startYear = system.date.getYear(system.date.getDate(2015, 11, 1))
	test = range(currentYear, startYear-1, -1)
	yearKeys = []
	for number in test:
	yearlyData = []
	for year in quarterLists:
		headers = ["Period", "Actual", "Budget", "Variance", "Variance Pct"]
		dataset = system.dataset.toDataSet(headers, year)
	for i in range(len(yearKeys)):
		data[yearKeys[i]] = yearlyData[i]

if I change the script to make the "yearKeys" start with a letter it works as expected; all the data shows up in the reporting components, etc. If this is just a limitation in the way that the reporting module allocates data keys, that's fine. I already got the workaround of just starting the key with a letter so no worries either way.

I'm using Ignition version 8.1.24, Reporting Module 6.1.24

Yep, that. We've considered trying to untangle that requirement from the reporting engine (you're not the first person this has happened to) but it's not a very pressing issue given the easy workaround.

1 Like

Sounds good, thanks for the quick reply. I was going in circles earlier trying to troubleshoot and as soon as I went to just one key named "test" everything populated, lost my damn mind over nothing lol

Similar bad behavior happens in some contexts where datasets have column names starting with digits. Avoid that, too.