User Tools

Site Tools


syntax:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
syntax:start [2021/07/21 15:22] dmitrysyntax:start [2025/06/24 00:18] (current) dmitry
Line 1: Line 1:
 ====== Expressions ====== ====== Expressions ======
  
-In EasyMorph you can use expressions to [[transformations:addcolumn|calculate new columns]] or build complex conditions for [[transformations:filter|filtering table rows]]. An expression is calculated for every row of a table and can include:+In EasyMorphyou can use expressions to [[transformations:addcolumn|calculate new columns]] or build complex conditions for [[transformations:filter|filtering table rows]]. An expression is calculated for every row of a table and can include:
  
   * Numbers and text strings (see [[syntax:types|Type system]])   * Numbers and text strings (see [[syntax:types|Type system]])
Line 9: Line 9:
  
 === Field names === === Field names ===
-You can refer to values in columns of the table where the expression is calculated by putting column names in square brackets, e.g. [Amount]. Field names can include spaces, digits and non-alphabetical characters in any order.+You can refer to values in columns of the table where the expression is calculated by putting column names in square brackets, e.g. [Amount]. Field names can include spaces, digitsand non-alphabetical characters in any order.
  
 When expression is calculated for a row, field names are replaced with values in these fields stored in the row. It's not possible to refer to values from another row or another table. When expression is calculated for a row, field names are replaced with values in these fields stored in the row. It's not possible to refer to values from another row or another table.
  
-Field names are case sensitive -- i.e. [Total], [TOTAL] and [total] are 3 different field names.+Field names are case sensitive -- i.e. [Total], [TOTAL]and [total] are 3 different field names.
  
 === Parameters === === Parameters ===
Line 29: Line 29:
 === Example 1 === === Example 1 ===
  
-Let's assume we want to calculate new field 'Net Amount' using the following expression:+Let's assume we want to calculate new field 'Net Amount' using the following expression:
  
   [Price] * [Quantity] * ( 100 - [Discount %] ) / 100   [Price] * [Quantity] * ( 100 - [Discount %] ) / 100
Line 42: Line 42:
 === Example 2 === === Example 2 ===
  
-Let's assume we want to calculate new field 'Total Tax' using the following expression:+Let's assume we want to calculate new field 'Total Tax' using the following expression:
  
   [Amount] * if( [Province]='QC', 13.5, 12.5) / 100 * {Multiplier}   [Amount] * if( [Province]='QC', 13.5, 12.5) / 100 * {Multiplier}
Line 55: Line 55:
  
  
-=== A few transformations that use expressions ===+=== A few actions that use expressions ===
   * [[transformations:addcolumn|Calculate new columns]]   * [[transformations:addcolumn|Calculate new columns]]
   * [[transformations:replacecolumns|Calculate and replace columns]]   * [[transformations:replacecolumns|Calculate and replace columns]]
Line 62: Line 62:
   * [[transformations:trimbycondition|Trim by condition]]   * [[transformations:trimbycondition|Trim by condition]]
   * [[transformations:halt|Halt on condition]]   * [[transformations:halt|Halt on condition]]
 +
 +=== Generating expressions from description ===
 +Starting from v5.9.6, it's possible to generate an expression from a description in plain English. To learn more, read [[syntax:generate|How to describe expressions]].
syntax/start.txt · Last modified: 2025/06/24 00:18 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki