Functions
Expression Syntax: Functions
Functions provides a rich tool set for creating useful expressions. DPL Studio includes an ever-growing number of built-in functions in various categories. Details on specific functions is availabe in Appendix B.
The syntax for any function takes the form: FunctionName(param1, param2, …) Most DPL functions are very tolerant in accepting a range of data types. For example, the function Upper converts a string to Uppercase. If given a scalar string, will Upper returns a scalar result (e.g., cost becomes COST). If given a vector of strings, Upper returns a vector with all strings converted to uppercase (e.g., price, units, cost becomes PRICE, UNITS, COST).
The arithmetic operators work in similar way. If you multiply a vector by a Scalar, the result will be a vector with each item multiplied by the scalar. If you multiply a vector by a vector, DPL Studio returns a vector where matching row indices have been multiplied by one another.
| Function | Expression | Result |
|---|---|---|
| Abs | Abs(-5) | 5 |
| Sum | Sum(Array(1,2,3)) | 6 |
| Upper | Upper(“a”) | A |
| Upper | Upper(Array(“a”, “b”, “c”)) | A B C |