Hi. I am working on a project where i need to do calculations based on physical length measurements. The data i get can consist of three different measurement units (meters, feet, and inches), and there is an arbitrary amount of measurements. The format is
[measurement1][unitX][measurement2][unitX][measurement..n][unit..X]
[measurement1][unitZ][measurement2][unitX][measurement..n][unit..Y]
[measurement1][unitZ][measurement2][unitY][measurement..n][unit..Z]
and so on. My calculations expect the data to be meters, so i have to convert the measurements to meters before i begin my calculations.
How would you go about dynamically converting these measurements to meters, when the units can jump around all over the place?
Solved! Go to Solution.
Could you do a find and replace on the unit? (I guess you would need to do this three times, unless you pivoted your data) So if you find an inch, append the value 0.0254, 'meter' => 1, etc. Then multiply by that conversion factor for each of your measurements.
If you provide some dummy data, I can mock something up.
Philip
It probably should be noted that there can be different amount of columns. in the mock i have depth, height, width, but a lot of other measurements can be present as well such as length, offset etc. so i feel like it has to be handled dynamically.
Hi @3p_khr ,
Perhaps something like the solution attached would work. You would just need to manually add the conversion amounts to the Text Input Tool.
Hope this helps,
Philip
Hi Philip.
This is just what i was looking for, what an elegant solution.
Thank you very much for the help.
User | Count |
---|---|
18 | |
14 | |
13 | |
9 | |
8 |