deed7307e95f889c530e6389384132ebeb067df4
Guides/ReportDesign/15.0-Expressions-in-Izenda.md
| ... | ... | @@ -16,6 +16,8 @@ This box accepts simple code which allows us to perform calculations on fields p |
| 16 | 16 | |
| 17 | 17 | An expression cannot be run on another expression. Since there can only be one layer of expressions, to process complex multipart equations some amount of calculation must be done by using a computed column from within a view. |
| 18 | 18 | |
| 19 | +An expression may output a value which is not the expected value for that field's data type. For example, we could use datediff() to calculate an integer number of days on a datetime column, leading Izenda to treat the integer value as a datetime. It is best practice to select a 'container' field that matches your expected output, to prevent unexpected behavior in the report designer. |
|
| 20 | + |
|
| 19 | 21 | |
| 20 | 22 | **Expressions can:** |
| 21 | 23 | |
| ... | ... | @@ -61,14 +63,6 @@ This would combine ‘Berlin’ and ‘Germany’ to ‘Berlin, Germany’. Not |
| 61 | 63 | |
| 62 | 64 |  |
| 63 | 65 | |
| 64 | -**In the same as in the example, we can add a static text denomination to a numerical value:** |
|
| 65 | - |
|
| 66 | -``[Freight] + ' USD' -> xxxx USD`` |
|
| 67 | - |
|
| 68 | -**We could also write:** |
|
| 69 | - |
|
| 70 | -``'$' + [Freight] -> $xxxx`` |
|
| 71 | - |
|
| 72 | 66 | **Parenthesis:** Prior to release 6.7.263, expressions that included escaped literal parentheses (**'\\\('** and **'\\\)'**) would not render correctly. This has been fixed. However, expressions that use non-escaped literal parentheses (**'\('** and **'\)'**) are still invalid to prevent SQL injection. |
| 73 | 67 | |
| 74 | 68 | ##15.3 Advanced Expressions |
| ... | ... | @@ -117,6 +111,8 @@ More information about using these functions can be found [[here|http://msdn.mic |
| 117 | 111 | |
| 118 | 112 | - **count(Distinct [OrderID])** produces a count of all distinct OrderID values. |
| 119 | 113 | |
| 114 | +- **datediff(part, [begindate], [enddate])** allows you to calculate the difference between two datetimes with a user selected level of granularity, for example the number of days, hours, or minutes between both input values. |
|
| 115 | + |
|
| 120 | 116 | - **distinct(OrderID)** produces a list of all distinct OrderID values. This is an _**Oracle only**_ function. |
| 121 | 117 | |
| 122 | 118 | - **isnull(OrderID, x)** checks to see if there is a null value in OrderID and replaces it with ‘x’. |