Method 1 is a computed field. It has code behind it, its values are dynamic. Method 2 is an ordinary or static field. For a computed field, as you say, the expression is built into how the field works
and the difference is decided when the field is created. You can't later convert a computed field into a static field, or vice versa. Nor can you manually change values in a computed field--you can't update or transform it. So I think it is natural for the Transform panel to target only static fields (although it can use computed fields as parameters and in expressions), and for computed fields to be created only in the Schema dialog (or in equivalent SQL--see below). I expect that the Transform panel could be changed so that it could optionally target a <new field>, computed or static, as long as there were also a means to specify its type. That might be a good idea, I don't know. My first impression is that the duplication of function would add confusion, and that it is clearer to keep the roles of the Schema dialog and the Transform panel distinct. But assuming that their roles should remain distinct, that doesn't mean they should not share some controls. On the contrary, similarity between dialogs can make things more intuitive for frequent users (muscle memory) and help new users. Manifold 9 already does this in many places, and it's great design. We have discussed the possible addition of an expression builder to the Expression control in Edit > Schema. I still think that is a good idea, and possibly the simplest way to make a workflow like yours more convenient. Maybe that will come when other planned changes are brought through. For now though, maybe the best way you can smooth your workflow is to use some handy SQL to add a frequently-used computed field wherever you need to. my expression which 95% of the time is rounddecs(GeomArea([Geom],0)/10000,0)
To add that computed field to [Drawing Table] in SQL, you would open an SQL command window (Ctrl-~) or create a new query, find the place where you have saved this snippet of code, copy and paste, adjust the table name... ALTER TABLE [Drawing Table] ( ADD [area (ha)] FLOAT64 AS [[ RoundDecs(GeomArea([Geom], 0) / 10000, 0) ]] ); ...then press F5 and you're done. If you need to do this to more than one table, paste the snippet N times, adjust the table name for each statement, then hit F5, and it is done N times. (And of course you can use the query builder here if you need to check SQL syntax or make edits.)
|