This is an automated email from the ASF dual-hosted git repository.

hansva pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hop.git


The following commit(s) were added to refs/heads/master by this push:
     new be607925e5 Update formula.adoc
     new 87c2b42bcb Merge pull request #3191 from Mattang-Dan/patch-10
be607925e5 is described below

commit be607925e590273c98456bb0a8facf75801e6e88
Author: Mattang-Dan <[email protected]>
AuthorDate: Thu Aug 31 07:15:33 2023 -0700

    Update formula.adoc
---
 .../modules/ROOT/pages/pipeline/transforms/formula.adoc  | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git 
a/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/formula.adoc 
b/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/formula.adoc
index dfe3193321..63219b2a39 100644
--- a/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/formula.adoc
+++ b/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/formula.adoc
@@ -38,6 +38,15 @@ under the License.
 
 The Formula transform allows you to apply Excel-like formulas and functions on 
fields in a pipeline.
 
+With a formula you are not limited to comparing to three fields like in the 
Calculator. This is where you can set and compare Date and Times as well.
+
+You have the option of creating a new field (use New field column) or 
replacing a field (use Replace value column).
+
+Formula Examples using the TEXT function:
+*      Int to Text: "size=" & TEXT([RowLimitInteger],"0").
+*      DateTime to Text: [StartDateField] & "=" & TEXT([StartDateTime], 
"yyyy-mm-dd")
+*      String to Text: "new_counter=" & TEXT([counter]+1, "0")
+
 |
 == Supported Engines
 [%noheader,cols="2,1a",frame=none, role="table-supported-engines"]
@@ -55,12 +64,13 @@ The Formula transform allows you to apply Excel-like 
formulas and functions on f
 |===
 |Option|Description
 |transform name|Change the name of this transform to explain the purpose of 
the formula fields you're adding.
-|New Field|the name of the new field that will be created from the formula
-|Formula|the formula that will be used to create the new field. Click on the 
field to open the Formula Editor (see the Formula Editor section for more 
details).
+|New Field|the name of the new field that will be created from the formula. 
The Formula transform requires a data row to create a new field. You can add a 
row generator with a single row as the first transform in your pipeline.
+|Formula|the formula that will be used to create the new field. Click on the 
field to open the Formula Editor (see the Formula Editor section for more 
details). To use a value from a data row field, use square brackets like 
[field1]. To use a parameter or variable, use the normal syntax ${param1}. If 
you use a parameter in place of text like with CONCATENATE (see samples) you 
must put double quotes around it. Example: CONCATENATE([field1], “${Param1}”)
+* Note: You may have to add quotes around variables in formulas as variables 
have no type.
 |Value type|the data type for the new formula field
 |Length|field length
 |Precision|field precision
-|Replace|select a pipeline field from the dropdown to replace that field's 
value with the formula result.
+|Replace value|select a pipeline field from the dropdown to replace that 
field's value with the formula result. Alteratively, you can pre-create the 
field with a NULL value in a “Get variables” transform.
 |===
 
 == Formula Editor

Reply via email to