DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Unit conversion in report table

Hi all.

 

I have what seems like a common use case that I can't figure out.  I want to create a report template that displays data in  Metric without changing the data in the file.  Eg: my channel is in feet, I want the table in the report to display meters.  I've figured out how to do this for 2D plots using a curve transformation script, but I can't figure out how to do it for a 2D table.  Any ideas?

CLAD
0 Kudos
Message 1 of 3
(2,134 Views)

What's that axiom about posting to the forum? Oh yeah: as soon as you do you'll figure it out on your own! If this is way harder than necessary please give me feedback.

 

Dropped a new table into report and created a new entry of type Expression.  Entered the following as the expression:

 

@@Data.Root.channelgroups(3).channels(2).values(D2TabRow)*0.304801@@

 

In the "Number of Rows" field I entered the following expression:

 

@@data.Root.ChannelGroups(3).Channels(2).Size@@

 

This seems to do it!  This would be a fantastic feature to bake into DIAdem though.  Previously I was scaling the channels and saving them to a new "metric" group in the file, which is just wasteful.

 

CLAD
0 Kudos
Message 2 of 3
(2,130 Views)

Hey CLAD,

 

FYI, since DIAdem 2017 the 2D tables in REPORT do have the option to select a target unit per column so that you can choose that column display to be in whatever target unit you want, without having to edit the unit property of the channel in the Data Portal that the column is referencing.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 3 of 3
(2,079 Views)