Provide code example when creating an Expression, Calculated or Calculation (Function) column

Related products: Software Factory

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

concat(t1.first_name, ' ' + t1.last_name)

I would use

concat_ws(' ',t1.first_name,t1.last_name)

Because the concat_ws will already exclude null values with the seperator. :)


NewOpen

Great idea indeed!


OpenOn the backlog

On the backlogWorking on it!

Working on it!Next release
 

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.

Image

 
 
 
 

Next releaseCompleted