Jump to content

Use drop-down list to convert column from Lb to Kg


Dominique Feteau

Recommended Posts

What I'd like to do is use a drop-down list that consists of two values, kg or lb, and when one is selected, have it run a calculation to convert a column (or multiple columns) from one to the other. The column is now in pounds. If the drop down is at "lb", then do nothing and use the value as-is. If it changes to "kg", then multiply each value in the column by 0.45359237.

It sounds easy in my head but I'm sure that it isn't. Any help would be appreciated.

Link to comment
Share on other sites

Maybe an easier way to do this would be to create Action controls instead of a drop down list. Add a new column in your data table that contains the converted value, then create two bookmarks, one that shows the lb value and one that shows the kg value. Next, create two Action controls, one for lb and one for kg, and have the action be the corresponding bookmark. Then you can click on one control to show the lb column, then click on the other control to show the kg column.
Link to comment
Share on other sites

Thanks Shandilya

 

I took your idea and came up with this within the visualization I was working on.  I had a function that I created in another report and just brought it over here.

 

CASE  
WHEN DocumentProperty("MassConversion")="kilograms" then cnv_LBtoKG(Sum([WEIGHT_LB]))
ELSE Sum([WEIGHT_LB])
END as [WEIGHT]

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...