0

I have to generate a report from a SQL query.

The report contains trade data in a certain unit of measure, the users want to be able to see the data in three different units of measure.

Is there a way of adding a parameter where you can to pick a unit of measure and then it will convert the data into that specified unit of measure and not filter for the unit of measure?

For example I have the following trade detail ID = 1 Amount = 100 MWH

I want to be able to change the parameters to allow me to see that amount in THERMS and KWH, I have the conversion factors it's just being able to choose between the three is the difficult part .

1 Answers1

0

Use a float parameter.

On the label enter the unit names and on the values set the modifiers based on the main unit.

The main unit will have modifier = 1

enter image description here

Your value expression will be like =Parameters!UnitModifier.Value * Fields!val.Value

enter image description here

niktrs
  • 9,858
  • 1
  • 30
  • 30
  • This is perfect thank you so much, also one last thing I wanted to have different decimal places for each unit. Is there any thing I can do about it? – Zakariya Kasu Jun 15 '21 at 21:29
  • You can use an Iif or Switch expression on the value textboxes format property to return a format string based on parameter selection. – niktrs Jun 16 '21 at 03:57
  • Could you show a visual example like you've done with the above? – Zakariya Kasu Jun 16 '21 at 13:25