KyleMcAfee Posted February 25, 2022 Report Share Posted February 25, 2022 What is wrong with this formula? Very new, so any help will be appreciated. CASE WHEN [@field:unit_of_measure] = 'Metric' THEN [@field:weight_lbs] = 2.204 * [@field:weight] ELSE [@field:weight_lbs] = [@field:weight] END *********** [unit_of_measure] is list string [weight] is number [weight_lbs] is number Need to save [weight_lbs] with the weight after converting from metric if needed, if not needed then just save the weight to [weight_lbs] Quote Link to comment Share on other sites More sharing options...
0 Kurumi Posted February 25, 2022 Report Share Posted February 25, 2022 Hi @KyleMcAfee - you may check my answer here: Quote Link to comment Share on other sites More sharing options...
0 KyleMcAfee Posted February 26, 2022 Author Report Share Posted February 26, 2022 MeeKeee, Each record will ask user if they want to enter data as US Standard or Metric. If they choose Metric, then I want the database to canvert the metric number to us standard and save results into new field as weight_lbs. This needs to be done for Langth, Width and Height as well. The system will convert the MM to Inches and save in length_inches. But some users will be using us standard as input so those numbers will not be converted but simply safe the same amount into weight_lbs or langth_inches. From your other reply sounds like field type list string is not the field type I should have used. Quote Link to comment Share on other sites More sharing options...
0 NailDyanC Posted February 26, 2022 Report Share Posted February 26, 2022 Hi @KyleMcAfee, to answer your question, it would be better if you will use a text(255) data type since you only have 2 options (metric or US standard) and you just need to choice between the two, right? With that, configure your DataPage to have a dropdown option and just input the two specific options on the custom values of the dropdown option. And for your calculation, you may try this: CASE WHEN [@field:unit_of_measure] = 'Metric' THEN 2.204 * [@field:weight] ELSE [@field:weight]END I believe, you want to store the result of the calculation above in your [@field:weight_lbs], right? Then if that is the case, you can make your [@field:weight_lbs] as a calculated value and put the formula above. I hope that helps. Quote Link to comment Share on other sites More sharing options...
Question
KyleMcAfee
What is wrong with this formula? Very new, so any help will be appreciated.
CASE
WHEN [@field:unit_of_measure] = 'Metric' THEN [@field:weight_lbs] = 2.204 * [@field:weight]
ELSE [@field:weight_lbs] = [@field:weight]
END
***********
[unit_of_measure] is list string
[weight] is number
[weight_lbs] is number
Need to save [weight_lbs] with the weight after converting from metric if needed, if not needed then just save the weight to [weight_lbs]
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.