Difference between revisions of "Formula Specification in Templates"

From wiki.fine.cz
Jump to navigation Jump to search
Line 50: Line 50:
|''IFS(Test1;Then1;Test2;Then2; ... ;Else)''
|''IFS(Test1;Then1;Test2;Then2; ... ;Else)''
|Checks whether one or more conditions are met and returns a value that corresponds to the first TRUE condition
|Checks whether one or more conditions are met and returns a value that corresponds to the first TRUE condition
|
|''Input'' '''''[GWT]''''' ''= 15''
''IFS('''[GWT]'''>8;10;'''[GWT]'''>6;9;'''[GWT]'''>3;8;-1) ⇒ 10''
|-
|-
|NOT
|NOT
Line 60: Line 61:
|''SWITCH(Switch;Case1;Result1;Case2;Result2; ... ;[ Else ])''
|''SWITCH(Switch;Case1;Result1;Case2;Result2; ... ;[ Else ])''
|Evaluates an expression against a list of values and returns the result corresponding to the first matching value. If there is no match, an optional default value may be returned
|Evaluates an expression against a list of values and returns the result corresponding to the first matching value. If there is no match, an optional default value may be returned
|
|''SWITCH(50>6;TRUE();44;FALSE();56;-111) ⇒ 44''
|}
|}


Line 156: Line 157:
|-
|-
|TAN
|TAN
|
|
|
|-
|<u>DEG</u>
|
|
|
|-
|<u>RAD</u>
|
|
|
|-
|<u>ROUNDUP</u>
|
|
|
|-
|<u>ROUNDDOWN</u>
|
|
|
|-
|<u>SUM</u>
|
|
|
|
Line 169: Line 195:
|-
|-
|CONCAT
|CONCAT
|
|
|
|-
|<u>LEFT</u>
|
|
|
|-
|<u>RIGHT</u>
|
|
|
|-
|<u>LENGTH</u>
|
|
|
|-
|<u>FIND</u>
|
|
|
|

Revision as of 12:50, 20 March 2023

List of formula specification using in Templates.

Categories of functions:

Logical

Name Syntax, parameters Description Example
AND AND(Boolean1;Boolean2; ... ) Returns TRUE if all of its arguments are TRUE AND(3=3;2=2) ⇒ TRUE
OR OR(Boolean1;Boolean2; ... ) Returns TRUE if any of its arguments are TRUE OR(3=4;2=3) ⇒ FALSE
TRUE TRUE() Returns the logical value TRUE IF(TRUE();1;2) ⇒ 1
FALSE FALSE() Returns the logical value FALSE IF(FALSE();1;2) ⇒ 2
IF IF(Test;Then;Else) Specifies a logical test to perform

- inputs can be linked to data

- result can be number, text, logical value

Result is number (bold inputs linked to data):

IF(220>200;220-200;200-220) ⇒ 20

IF(MAX([Y_PDL⇕])>MAX([X_PDL⇕]);+1;-1)

Result is text:

IF([Coordinate Z]>0;"Top above terrain";"Top under terrain")

IF([GWT]<[Coordinate Z];"GWT under top of the test.";"Measure error.")

IFS IFS(Test1;Then1;Test2;Then2; ... ;Else) Checks whether one or more conditions are met and returns a value that corresponds to the first TRUE condition Input [GWT] = 15

IFS([GWT]>8;10;[GWT]>6;9;[GWT]>3;8;-1) ⇒ 10

NOT NOT(Boolean) Reverses the logic of its argument
SWITCH SWITCH(Switch;Case1;Result1;Case2;Result2; ... ;[ Else ]) Evaluates an expression against a list of values and returns the result corresponding to the first matching value. If there is no match, an optional default value may be returned SWITCH(50>6;TRUE();44;FALSE();56;-111) ⇒ 44

Mathematical

Name Syntax, parameters Description Example
ABS
ACOS
ACOT
ASIN
ATAN
COS
SIN
COT
TAN
EXP
LN
LOG
LOG10
PI
POWER
SQR
SQRT
TAN
DEG
RAD
ROUNDUP
ROUNDDOWN
SUM

vvv

Text

Name Syntax, parameters Description Example
CONCAT
LEFT
RIGHT
LENGTH
FIND

vvv

Statistical

Name Syntax, parameters Description Example
AVERAGE
MAX
MIN

vvv

Matrix

Name Syntax, parameters Description Example
LINEARTREND
LINEARTRENDANDPOINTS
LINEARTRENDSC
LINEARTRENDSCANDPOINTS
LINEARTRENDTOPOINTS
SEMICIRCELTOPOINTS

vvv