When creating a table column that has a calculation type, it is necessary to write some code. Based on the type, the structure of the code will be different from one and other. Such like Expression columns, you can make use of the “T1.” alias, which is the table itself, whilst Calculated columns cannot use this.
Just like the code example in Control procedure for SQL-typed CP's, I would like a short example that shows me as a developer what I can (and cannot) use as code.
Example:
- Expression:
concat_ws(' ', t1.first_name, t1.last_name) --Thanks @Robbert :)
- Calculated:
(100.0 + tax_percentage) / 100.0
- Calculated (function):
select sum(order_total) from sales_order where sales_order_id = @sales_order_id
Great idea! I always get the proxy function wrong!
Great!
1 small addition: instead of
I would use
Because the concat_ws will already exclude null values with the seperator. :)
Great idea indeed!
To explain the subtle differences between the query structure for calculated field types, a code example will be added to the query field when using a calculation type for a column. Switching between calculated field types will overwrite the present example if possible.