Unit of measure conversion with a Linked Table

Discussion created by JanvanderVen on Nov 11, 2010
Latest reply on Nov 11, 2010 by spilon

Dear all,




I am using AF 2.1.


I am faced with the following problem. I have to retrieve data from a linked table for pressure readings. One column, let's call it Pressure, holds the value and another column, let's call that one UOM, holds the unit of measure.


The crux of the matter is that not all UOM are equal. Some in Pa, some in bar, some in N/m2.


I found out that if I define the attribute as Double, and with a UOM of Pa, I can pass in a string: "23 bar" which gets correctly translated to Pascals.


That's great.


I then went on and concatenated my two columns and pointed the attribute to that field (in the linked table it is now of type String, but the attribute still is a Double. This gives me the error message: Cannot specify a UOM for the value '23 bar     '. UOMs are not supported for the type 'System.String'. I did a quick check: trimming does not help.


I think that is not a fair error message, as the attribute still is of the Double type.


It might be I am heading down the wrong trail altogether.


Any thoughts will be greatly appreciated.




Kind regards,