Reports - Showing data in a table

Hello,

I have been struggling to create a report for a while now and what I'm trying to do seems simple, so I figured I would finally reach out for some help. I have 5 historian tags I want to display the data for. The tags are boolean tags that go true every once in a while, I want to report on how much time the boolean tags are true over a given time. I want to display the data in 3 ways.

  1. I want to display it on a pie chart, I was able to get this working as intended.
  2. I want to display it on a bar chart, where each tag has it's own bar, so for example, tag1 has a duration of 300 seconds, while tag2 has a duration of 36 seconds. The bar chart should have one bar per tag.
  3. I want to display the data on a table as well, just a basic table with 2 columns. Name, and duration.

In my attempts to do this, I have been unsuccessful. Here's the data I am working with:

<sample-data>
	<!--This is the raw data used to create the report preview.-->
	<EndDate>2023-07-17 11:50:54.197</EndDate>
	<Report>
		<Gateway>RedactedGatewayName</Gateway>
		<Name>Report</Name>
		<Path>Report</Path>
		<Timestamp>2023-07-17 11:50:54.197</Timestamp>
	</Report>
	<StartDate>2023-07-17 03:50:54.197</StartDate>
	<tag_calcs>
		<row-0>
			<t_stamp>2023-07-17 03:50:54.197</t_stamp>
			<tagpath>Tag1</tagpath>
			<DurationOn>843</DurationOn>
		</row-0>
		<row-1>
			<t_stamp>2023-07-17 03:50:54.197</t_stamp>
			<tagpath>Tag2</tagpath>
			<DurationOn>75</DurationOn>
		</row-1>
		<row-2>
			<t_stamp>2023-07-17 03:50:54.197</t_stamp>
			<tagpath>Tag3</tagpath>
			<DurationOn>0</DurationOn>
		</row-2>
		<row-3>
			<t_stamp>2023-07-17 03:50:54.197</t_stamp>
			<tagpath>Tag4</tagpath>
			<DurationOn>722</DurationOn>
		</row-3>
		<row-4>
			<t_stamp>2023-07-17 03:50:54.197</t_stamp>
			<tagpath>Tag5</tagpath>
			<DurationOn>303</DurationOn>
		</row-4>
	</tag_calcs>
</sample-data>

If someone could please help me to accomplish this I would appreciate it.

Take a look at the User Manual
https://docs.inductiveautomation.com/display/DOC81/Report+-+Bar+Chart

Especially the first paragraph

A Bar Chart typically contains a single string column that gets used as the Domain with as many other columns representing the Range axis values. The order of the dataset matters, and the string values used for the domain should be in the first column of the dataset.

You want tagpath to be your domain but you have t_stamp in the first column.

1 Like

Thanks Tim,

Do you know how I can get rid of the t_stamp data entirely? I'm using a Tag Calculation Query and I don't see any option to not include the timestamp.

You need to add a new data source of type Script. Add it after your tag_calc source. In the script create a new data source that contains only the two columns you want.

See "Python - Building a New Data Source" near the bottom of this page:
https://docs.inductiveautomation.com/display/DOC81/Scripting+Data+Source

1 Like

Thank you, this is super helpful. I have the bar chart working now, and now I understand how I can manipulate the data to fit each component on the report.

1 Like