execute search syntax

Custom Operators

Type

Operator

Example

Numerical Operators

+-*/:basic operators
% : Modulo operator
^ : Power operator

(-1 + 50*2 ) / ( 2^4 )

Boolean operators

~, xor : operators
&&, and : And operators
||, or : Or operators
!, not : Not operators
< : less operator
> : great operator
<= : less or equal operator
>= : great or equal operator
==, equals : equal operators
!=, <> : not equal operators

 

 

 

!(A && (B < 10))  |  NOT ( A XOR ( B equals C ) )
A != 2 || B > 2
"string1" == "string2"
A or B
A or ( B <> C )

String operators

== : 2 strings equals
!= : 2 strings not equals
<> : 2 strings not equals
< : The first string less lexically than
the second one
> : The first string great lexically than
the second one
<= :The first string less or equals lexically than
the second one
>= : The first string great or equals lexically than
the second one
+ : Concat string

"string1" == "string2"  : false
"string1" + "a" : "string1a"
"abc" > "aaa" : true
"zyx" < "bcd" : false

List operators

+ : Concat two lists
- : Substract a list to another one
in : Test if an element is inside a list

(1,2)+(3,4) = (1,2,3,4)
(1,2) + 3 = (1,2,3)
3+(1,2)=(1,2,3)
(1,2,3,4)-(3,4)=(1,2)
(1,2,3,4)-3=(1,2,4)
2 in (1,2,3)=true
4 in (1,2,3)=false

Other operators

= : set a variable operator
[] : absolute value
² : power 2 operator
% : Percent operators

A = [ 2 - A ] * 2

 

2²
10%=0.1

Conditional operators

if then
if then else

if ( A > 2 ) then ("Ok")
if ( A <=2 ) THEN (B=3) else (B=4)

Custom functions

Described below

 

 

Custom Functions

Name

Description

Function signature

format

Formats decimal number. Default format is #.##.

format (n) - returns the decimal number n in the format '#.##'.

number

Parses string to number (double).

number (s) - parses the string v as a double.

timeformat

Formats a number as date/time string. Default time format is "MM/dd/yyyy HH:mm:ss.SSS".

timeformat (n,f) - formats the double value n to the date/string f

mapput

Puts a key/value pain in a map. If the given map was not declared prior to this function, then this function creates it.

Note: the function returns the result map.

mapput (m,k,v) - returns the new map m after putting the value v using the key k.

mapput(m,m2) - Returns the new map m after putting the map m2 in it.

mapget

Returns a value from a map using a key.

mapget (m,k) - returns the value in m to which the key k is mapped.

mapkeys

Returns all the map's keys.

mapkeys (m) - returns all the keys of map m.

mapvalues

Returns all the map's values.

mapvalues (m) - returns all the values of map m.

mapremove

removes a mapping from a map using a key

mapremove (m,k) - removes from the map m the mapping for key k, if present.

listget

returns the element in a list at a specified position

listget (l,i) - returns the element at position i in list l.

 

Custom Aggregation Functions

Name

Description

Function Signature

aggAvg

returns the aggregated average value of a parameter.

aggAvg (p) - returns the aggregated average value of given parameter p.

aggSum

returns the aggregated sum value of a parameter.

aggSum (p) - returns the aggregated sum value of given parameter p.

aggSum

returns the aggregated sum value of a parameter.

aggSum (p) - returns the aggregated sum value of given parameter p.

aggMax

returns the aggregated max value of a parameter.

aggMax (p) - returns the aggregated max value of of given parameter p.

aggMin

returns the aggregated min value of a parameter.

aggMin (p) - returns the aggregated min value of given parameter p.

mapAggAvg

returns aggregated avg map

mapAggAvg  (k,v) - returns map that each value v is aggregated avg result

for given key k.

 

 

mapAggSum 

returns aggregated sum map

mapAggSum  (k,v) - returns map that each value v is aggregated sum result for given key k.

 

Custom Basic Functions

  • random - A random value from 0 to 1.

  • strlen - Compute the length of a string.

  • sqrt - Square root .

  • avg - The average of the arguments.

  • cos - Cosine with a radian argument.

  • acos - Arc cosine with a radian argument.

  • asin - Arc sine with a radian argument.

  • atan - Arc tan with a radian argument.

  • exp - Compute the euler's number e raised to the power of the argument.

  • floor - the largest (closest to positive infinity) double value that is less than or equal to the argument and is equal to a mathematical   integer.

  • int - Convert the double argument to integer.

  • logn - Natural logarithm in n base : logn( BASE, VAL).

  • log 10 - Natural logarithm in 10 base.

  • log - Natural logarithm in e base.

  • pow - The first argument power the second one.

  • prod - The product of the arguments.

  • round - The closest long to the argument.

  • sin - Sine with a radian argument.

  • tan - tan with a radian argument.

  • degTorad - Convert angle from degrees to radians.

  • radTodeg - Convert angle from radians to degrees.

 

Complete syntax can be found here: http://www.japisoft.com/formula/doc/index.html

Â