Open main menu

TaticView β

Changes

Expressions

6,388 bytes added, 02:26, 5 October 2022
Marked this version for translation
<languages/>
 
 
<translate>
<!--T:168--><div class="index-right">__TOC__</div> <!--T:69-->You can create expressions (formulas) directly in the dashboard components. It can thus display calculated values that are not present in the datasource file/spreadsheet.  <!--T:70-->To create the expression (formula) in the components, the component must support the addition of the special column ''Expression (Formula)''.  <!--T:71-->In TaticView , all columns in the data file can be used in expressions as long as they are also added to the component that will receive the expression.  <!--T:72-->Expressions allows In addition, it is also possible to manually use fixed numbers and texts in the case of comparative expressions.  <!--T:73-->Expression Example: <!--T:74-->* If the component has the columns ''Total Price'' and ''Quantity'', you can create and edit an expression to calculate the ''Unit Price''. Would be like this:** ''"Total Price"'' / ''"Quantity"''* In addition, you can use fixed values, such as:** ''"Total price"'' / 10  <!--T:75-->We just remember that currently TaticView only supports expressions whose numeric return.  <!--T:225-->Expressions support the backslash as [[FiltersEscapeChar|escape character]] rules so that names can contain the delimiting characters. <!--T:76-->Below are details about how the expressions work: == Basic structure of a Expression (Formula) == <!--T:77--> ==== Identifier ==== <!--T:226--> <!--T:227-->It is the name of the field or column involved in the expression, it must be delimited by double quotes. <!--T:228-->* Examples: "Average Price". "Screw 1\" philips", "Seler" ==== Value Operand ==== <!--T:78--> <!--T:79-->It's the numerical values. You can use both while values and decimal values. For decimal values, the decimal separator should be the point. <!--T:80-->* Examples: 1, 1.05, 2.55 <!--T:220-->* Important: Do not use thousand separator in numeric values. ==== Text Operand ==== <!--T:81--> <!--T:82-->It's the text operands. If you want to use this type of operand in a expression, you must delimit them by the single quotation mark ('). <!--T:83-->* Examples: 'John Snow', 'California', 'Spaghetti'  ==== Date Operand ==== <!--T:84--> <!--T:85-->These are values that express any date. To represent a date in expressions the behaviour is similar to text operands, i.e. the content must be surrounded by single quotation marks ('). However, the mask ''dd/MM/yyyy'' must be used. <!--T:86-->* Examples: '01/01/2019', '14/11/2019', '25/12/2019'  ==== Boolean Operand ==== <!--T:87--> <!--T:88-->They're operators of the true or false type. Normally user to validate, or not, a condition in a more complex expression. <!--T:89-->* Examples: true, false  ==== Parentheses ==== <!--T:90--> <!--T:91-->Used to group and separate parts of on expression. Expressions within parentheses are processed first. <!--T:92-->* Example: ("Profit"/"Total Price") + 10  ==== System variable Operand ==== <!--T:93--> <!--T:94-->These are predefined variables in the system. To use the system variables you must precede them by hashtag (#) and delimit them by using programming languagedouble quotes("). Currently only the "#null" variable is available and indicates null content. <!--T:95-->* Example: IF("Product" == "#null";0;20) == Arithmetic Expressions == <!--T:96--> <!--T:97-->Arithmetic expressions relate two operands (which can be any the operands described above, or another expression) to make up the sum, subtraction, multiplication or division.  ==== Sum (+) ==== <!--T:98--> <!--T:99-->Add two value operands or another expression result. Represented by the ''+'' charecter. <!--T:100-->Syntax: <operating or expression result> '''+''' <operating or expression result>Example: '''"Taxes" + "Commissions"''' - Sums the values of the fields ''Taxes'' and ''Commissions''  ==== Subtraction (-) ==== <!--T:101--> <!--T:102-->Subtract two value operands or another expression result. Represented by the ''-'' charecter. <!--T:103-->Syntax: <operating or expression result> '''-''' <operating or expression result>Example: '''"Price" - "Taxes"''' - Subtracts the values ​​from the ''Price'' and ''Taxes'' fields.  ==== Multiplication (*) ==== <!--T:104--> <!--T:105-->Multiplies two value operands or another expression result. Represented by the multiplication charecter ''*''. <!--T:106-->Syntax: <operating or expression result> '''*''' <operating or expression result> Example: '''"Quantity" * "Unit Price"''' - Multiplies the value of the ''Quantity'' field by the value of the ''Unit Price'' field.  ==== Division (/) ==== <!--T:107--> <!--T:108-->Divide two value operands or another expression result. Represented by the division charecter ''/''. <!--T:109-->Syntax: <operating or expression result> '''/''' <operating or expression result>Example: '''"Price" / "Quantity"''' - Divides the value of the ''Price'' field by the value of the ''Quantity'' field.  == Relational Expressions == <!--T:110--> <!--T:111-->Relational expressions compare two operands (value/text or other expression) to assess whether a condition is true or false. Normally used with decision functions, such as ''IF''.  ==== Equality (==) ==== <!--T:112--> <!--T:113-->It compares if two operands are the same, returning true if they are the same or false if they are different. Represented by the equality operator ''==''. <!--T:114-->Syntax: <operating or expression result> '''==''' <operating or expression result>Example: '''IF("Product" == "#null";0;20)''' - If the ''Product'' is null, return the value ''0''. Otherwise return the value ''20''  ==== Different (!=) ==== <!--T:115--> <!--T:116-->It compare if two operands are different, returning true if they were different or false if equal. Represented by the differente operator ''!=''. <!--T:117-->Syntax: <operating or expression result> '''!=''' <operating or expression result>Example: '''IF("Product" != 'Lasagna';0;20)''' - If the ''Product'' is different from ''Lasagna'', return the value ''0''. Otherwise return the value ''20''  ==== Greater than (>) ==== <!--T:118--> <!--T:119-->Compares if the first operator (from the left) is greater than the second operator (from the right), returning true if it is greater and false if it is lesser or equal. Represented by the greater operator ''>''. <!--T:120-->Syntax: <operating or expression result> '''>''' <operating or expression result>Example: '''IF("Gross Value" > 1000;1;0)''' - If the ''Gross Value'' is greater than ''1000'', returns the value ''1'', if not the value ''0''  ==== Greater or equal to (>=) ==== <!--T:121--> <!--T:122-->Compares if the first operator (from the left) is greater or equal to the second operator (from the right), returning true if it is greater or equal and false if it is lesser. Represented by the greater or equal operator ''>=''. <!--T:123-->Syntax: <operating or expression result> '''>=''' <operating or expression result>Example: '''IF("Gross Value" >= 2500;100;0)''' - If ''Gross Value'' is greater than or equal to ''2500'' returns ''100'', otherwise returns ''0''  ==== Less than (<) ==== <!--T:124--> <!--T:125-->Compares if teh first operator (from the left) is lesser than the second operator (from the right), returning true if it is lesser and false if it is greater or equal. Represented by the Lesser operator ''<''. <!--T:126-->Syntax: <operating or expression result> '''<''' <operating or expression result>Example: '''IF("Gross Value" < 100;50;200)''' - If ''Gross Value'' is less than ''100'', returns ''50'' if not ''200''  ==== Less or equal to (<=) ==== <!--T:127--> <!--T:128-->Compares if the first operator (from the left) is lesser or equal to the second operator (from the right), returning true if it is lesser or equal and false if it is greater. Represented by the lesser or equal operator ''<=''. <!--T:129-->Syntax: <operating or expression result> '''<=''' <operating or expression result>Example: '''IF("Gross Value" <= 500;100;0)''' - If ''Gross Value'' is less than or equal to ''500'' returns ''100'', if not ''0''  == Logical Expressions == <!--T:130--> <!--T:131-->Logical expressions group together two operands (Boolean or other expression) to make up a logical expression, in order to evaluate the relationship of two Boolean operators to a true or false result. This type of expression is usually used for decision making, such as IF and with relational expressions.  ==== And Operator (&&) ==== <!--T:132--> <!--T:133-->Executes the logical operation ''AND'' between two Boolean values. Both values must return true so that the result of the operation is true. Represented by the ''&&'' operator. <!--T:134-->Syntax: <expression> && <expression>Examples: '''IF(("Price" > 0) && ("Seller" == 'John Snow');450;0)''' - If ''Price'' is greater than ''0'' '''AND''' ''Seller'' is equal to ''John Snow'', returns ''450'' if not returns ''0'' '''IF(("City" != "#null") && ("Product" != 'Lasagna');1;0)''' - If ''City'' is non-null '''AND''' ''Product'' is different from ''Lasagna'' returns ''1'' if it does not return ''0''  ==== Or Operator (||) ==== <!--T:135--> <!--T:136-->Performs the logical ''OR'' operation between two Boolean values. A two values must be true so that the result of the operation is true. Represented by the operator ''||''. <!--T:137-->Syntax: <expression> || <expression>Examples: '''IF(("Price" > 1000) || ("Profit" >= 50);75;55)''' - If ''Price'' is greater than ''1000'' '''OR''' ''Profit'' is greater than or equal to ''50'' returns ''75'' if not ''55'' '''IF(("City" != "#null") || ("Product" != 'Lasagna');1;0)''' - If ''City'' is non-null '''OR''' ''Product'' is different from ''Lasagna'' returns ''1'' if it does not return ''0''   ==== Denial Operator (!) ==== <!--T:139--> <!--T:140-->Performs the logical negation operation for a boolean value. If the result of the operation is true the negation operator converts to false and vice versa. Represented by the operator ''!''. <!--T:141-->Syntax: !<expression>Example: '''IF(!BETWEEN("Delivery Date"; '01/01/2015'; '31/12/2015');2016;2015)''' - If the ''Delivery Date'' is '''NOT''' between ''01/01/2015'' and ''12/31/2015'' returns ''2016''. If between this period returns ''2015''  == Auxiliary Functions == <!--T:142--> <!--T:143-->Basic helper functions are standard system functions and implement useful features for composing complex expressions.  ==== ABS function ==== <!--T:144--> <!--T:145-->Function that returns the absolute numeric value of a base numeric value. <!--T:146-->Syntax: ABS(<value operator or expression>)Example: '''ABS("Price" / "Quantity")''' - Returns the absolute value of ''Price'' divided by ''Quantity''  ==== AVG function ==== <!--T:147--> <!--T:148-->Returns the average of the values ​​of a sequence of values. It can be used to return the average of different values ​​of the same row of tables. <!--T:149-->Syntax: AVG(<expression 1>; <expression 2>; ...)Example: '''AVG("Taxes"; "Profit"; "Cost")''' - Returns the average between the sum of the ''Taxes'', ''Profit'' and ''Cost'' columns  ==== BETWEEN function ==== <!--T:150--> <!--T:151-->Checks whether a value is within the limits of the parameters used. Return true or false. <!--T:152-->Syntax: BETWEEN(<expression to be tested>; <initial limit>; <end limit>)Example: '''BETWEEN("Date Issued"; '01/01/2019'; '31/12/2019')''' - Returns true if ''Date Issued'' is between ''01/01/2019'' and ''12/31/2019''. Otherwise returns false ==== COUNT function ==== <!--T:229--> <!--T:230-->Returns number of occurrences (lines) for column or value. <!--T:231-->By now this functions works only at Datasource expressions <!--T:232-->Syntax: COUNT(<expression>) Example: '''COUNT("Product")''' - Returns number of occurrences (lines) of products ==== COUNT_DISTINCT function ==== <!--T:233--> <!--T:234-->Returns number of unique occurrences (lines) for column or value. <!--T:235-->By now this functions works only at Datasource expressions <!--T:236-->Syntax: COUNT_DISTINCT(<expression>) Example: '''COUNT_DISTINCT("Product")''' - Returns number of unique (different) occurrences (lines) of products ==== IF ELSE function (If .... Otherwise ...) ==== <!--T:153--> <!--T:154-->Tests a Boolean expression and applies a condition to true or another condition to false. You need three parameters, separated by semicolons (;). The first parameter is the expression to be tested, the second the value to be applied in case of true, and the third to be applied in case of false. <!--T:155-->Syntax: IF(<expression to be tested>; <expression if true>; <expression if false>)Examples: '''IF(BETWEEN("Value";0;100);10;250)''' - If ''Value'' is between ''0'' and ''100'' returns ''10'', if not ''250'' '''IF("Profit" == 0;0;"Profit" + "Taxes")''' - If ''Profit'' equals ''0'' returns ''0'', if it does not return the sum between ''Profit'' and ''Taxes'' '''IF("Product Code" == 3231;0;"Quantity" * 3;"Quantity")''' - If ''Product Code'' equals ''3231'' returns ''Quantity'' plus 3 ==== LOG function ==== <!--T:157-->
<!--T:2158-->'''Important''': After manually editing Returns the expressionlogarithm of a number on a defined basis. It can be used with only one parameter, in this case the regular operators can not "base 10" logarithm is used . If two parameters are used, the second server to inform the base to be used until you ''Clear All'' by the filters;logarithm.
<!--T:159-->
Syntax:
LOG(<expression>;<base>)
Examples:
'''LOG("Profit")'''- Returns the logarithm of the field ''Profit''
'''LOG("Price";2)''' - Returns the logarithm of the ''Price'' field in base ''2''
<!--T:3-->
__TOC__
==== MAX function ==== <!--T:161-->
== Basic Expression Structures == <!--T:4162-->Returns the largest value between two values.
<!--T:163-->
Syntax:
MAX(<expression 1>;<expression 2>)
Example:
'''"Value" / MAX("Quantity";1)''' - Divides ''Value'' by the largest value between ''Quantity'' and ''1''
=== Value Operands === <!--T:5-->
==== MIN function ==== <!--T:6164-->The value operands are values from a [[Columns Data Type|data type]] that are used in expressions as variables.
<!--T:165-->
Returns the smallest value between two values.
==== Value type operand ==== <!--T:7166-->Are numeric values of the float type Syntax: MIN(<expression 1>; <expression 2>)Example: '''"Value" / MIN(Real numbers domain"Cost"; 100). These values allow the use of a integer and a fraction part, separated ''' - Divides ''Value'' by the dot (.) character (decimal separator). smallest value between ''Cost''and 'Examples'100'': 1, 1.05, 2.55;
==== Text type operand ==== <!--T:8-->
Are literal string data operands. These values allow the use of characters chain fields (strings), being delimited by the simple quote (') character.
'''Examples''': 'John Snow', 'California', 'Spaghetti';
==== Date type operand POWER function ==== <!--T:9167-->Are values that express any date. It is possible to determine a date representing it as a string, being delimited by the simple quote (') character and separated by the bar (/) character. The default supported format is "dd/MM/yyyy". '''Examples''': '01/01/2011', '29/02/2000';
==== Boolean type operand ==== <!--T:10168-->Are values from Returns the ''true'' or ''false'' kindpower of a value in a defined exponent. Usually It can be used to validate or not with only one parameter, in this case it considers the default exponent 2. If a conditionsecond parameter is passed, this will be the exponent. '''Examples''': true e false;
==== Identifier type operand ==== <!--T:11169-->Are values that represents a field or variable in the Syntax: POW(<expression. Used to make reference to data source columns, delimited by double quotes >; <exponent>)Examples: '''POW("Profit")''' - Returns the power of the ''Profit'' value. '''ExamplesPOW("Cost"; 3)''' - Returns the power of the ''Cost'': "City.City"value, "Product.Product";raised to ''3''
==== Parenthesis ==== <!--T:12-->
Used to group and separate expressions parts. Expressions inside parenthesis are processed first.
'''Examples''': ("Profit" / "Total Price" ) + 10
==== System variable type operand RANDOM function ==== <!--T:13171-->Are system pre-defined variables. These values are replaced in run-time by pre-determined values, delimited by double quotes (") and preceded by star (#). By now only one variable is available: "#null" that indicates null values or fields.
<!--T:172-->
Returns a random number within the range of values ​​passed as arguments.
=== Arithmetic Expressions === <!--T:14173-->Syntax: RANDOM(<start limit>; <end limit>)Example: '''RANDOM(10;100)''' - Returns a random number between ''10'' and ''100''
==== ROUND function ==== <!--T:15222-->The arithmetic expressions relate two operands (value or another expression) to compose a sum, subtraction, multiplication or division.
==== Sum (+) ==== <!--T:16223-->Sum two operands. Represented by Returns the sum (+) character. Syntax: ''<operand/expression> + <operand/expression>''rounded value of a value column or value. '''Examples''': "Taxes" + "Commissions";
==== Subtraction (-) ==== <!--T:17224-->Subtract two operands. Represented by the subtract or hyphen Syntax: ROUND(-<value>;<precision>) character. SyntaxExample: '''ROUND("Profit")'''<operand/expression> - <operand/expression>If Profit 10.38 returns 10.00 '''ROUND(15.65)'''- Returns 16. 00 '''ExamplesROUND(1.777;1)''': "Gross Sale" - "Taxes";Returns 1.8
==== Multiplication SQRT function (*Square Root) ==== <!--T:18174-->Multiplicate two operands. Represented by the multiplication or star (*) character. Syntax: ''<operand/expression> * <operand/expression>''. '''Examples''': "Amount" * "Unit Price";
==== Division(/) ==== <!--T:19175-->Divides two operands. Represented by Returns the divide or bar (/) character. Syntax: ''<operand/expression> / <operand/expression>''. '''Examples''': "Total Value" / "Amount"square root of a value.
<!--T:176-->
Syntax:
SQRT(<value or expression>)
Examples:
'''SQRT("Profit")''' - Returns the square root of the value ''Profit''
'''SQRT(81)''' - Returns the square root of ''81''
=== Relational Expressions === <!--T:20-->
==== LIKE function ==== <!--T:21178-->The relational expressions compare two operands (value or another expression) two evaluate if a condition is ''true'' or ''false''. Usually used with decision functions, like the ''IF''.
==== Equal (==) ==== <!--T:22179-->Performs Returns true if the equal comparison expression between desired content is found in the list and false otherwise. It needs two operandsparameters, the first is the data to query and the second is the term to be found. Represented by Remembering that it is necessary to use the equal wildcard operator (==)“%” and surround the term by single quotation mark. Syntax: ''<expression> == <expression>''. '''Examples''': "Unit Price" == "Total Price";
==== Different (!=) ==== <!--T:23180-->Performs the different comparison expression between two operands. Represented by the different operator Syntax: LIKE(!=< data>; <term>). SyntaxExample: '''LIKE("Product"; '%anh%')'<expression> != <expression>''. - Returns true if the ''Product'Examples'contains the term '': "City.City" != anh'New York';or false otherwise
==== Greater than (>) ==Date Functions == <!--T:24181-->Return ''true'' if the the first expression is greater than the second expression and ''false'' otherwise. Represented by the greater operator (>). Syntax: ''<expression> > <expression>''. '''Examples''': "Order Date" > '01/01/2011';
==== Greater or equal than (>=) ==== <!--T:25182-->Return ''true'' if the the first expression is greater than or equal to the second expression Date functions are operations that take a date as a parameter and ''false'' otherwisealso return a date. Represented by the greater or equal operator (>=). Syntax: ''<expression> >= <expression>''. '''Examples'''There are some constants to assist in using date functions, they are: IF("Order Date" >= '01/01/2011';"Order Date";0);
==== Lesser than (<) ==== <!--T:26183-->Return * 0: ''trueDATE_FIELD_YEAR'' if (Part of the the first expression is lesser than the second expression and year)* 1: ''falseDATE_FIELD_MONTH'' otherwise. Represented by the lesser operator (<Month Part). Syntax* 2: ''<expression> < <expression>DATE_FIELD_DAY''. (Daypart) * 3: ''DATE_FIELD_FORTNIGHT'Examples'(Part of fortnight)* 5: '': "Profit" < DATE_FIELD_WEEK'0';(Part of the Week)
==== Lesser or equal than (<=) ==== <!--T:27-->
Return ''true'' if the the first expression is lesser than or equal to the second expression and ''false'' otherwise. Represented by the lesser or equal operator (<=).
Syntax: ''<expression> <= <expression>''.
'''Examples''': IF("Order Date" <= '01/01/2011';"Order Date";0).
==== DATE_PART function (Date Part) ==== <!--T:184-->
=== Logical Expressions === <!--T:28185-->Returns part of a date. It needs two parameters, the first is the reference date and the second is the constant that represents which part of the date we want to get.
<!--T:29186-->The logical expressions group two operands Syntax: DATE_ PART(boolean type or another expression<date>; <constant representing which part>) to compose a logic expression, with the objective to evaluate two boolean operands relation into a Example: ''true'DATE_ PART("Issued Date"; 0)' or ''false'' result. Usually used with decision functions, like - Returns the year portion of the ''IFIssued Date'' and with relational expressions.
==== And DAY_FROM_TODAY function (&&Days from today) ==== <!--T:30187-->Performs the logical operation ''AND'' between two boolean values. The two operands must be ''true'' for the result of the operation to be ''true''. Represented by the ''AND'' operator (&&). Syntax: ''<expression> && <expression>''. '''Examples''': IF((Gross Sales > '0') && (Seller == 'John Snow');'Sold';'Not Sold'), IF((City!="#null") && (Date<DAY_FROM_TODAY(0));1;0);
==== Or (||) ==== <!--T:31188-->Performs the logical operation ''OR'' between two boolean valuesReturns a days count backward (negative) or forward (positive) from today. One of You need a parameter that indicates the two operands must be ''true'' for the result number of the operation days to be ''true''. Represented by the ''OR'' operator (||). Syntax: ''<expression> || <expression>''add or subtract. '''Examples''': IF((Gross Sales > '0') || (Sold == 'true');'Sold';'Not Sold'), IF((City!="#null") || (Date<DAY_FROM_TODAY(0));1;0);
==== Not (!) ==== <!--T:32189-->Performs the denial logical operation for a boolean value. If the operand are ''true'' the ''NOT'' convert it to ''false'' Syntax: DAY_FROM_TODAY(and the other way around<number of days>). Represented by the ''NOT'' operator (!). SyntaxExample: ''! <expression>''. '''Examples''': IFDAY_FROM_TODAY(!BETWEEN("Date", '01/01/2013', '31/12/2013'-1);'Not 2013';'2013- Returns yesterday').s date
== Auxiliary Functions == FIRST_DAY_OF function (First day of) ==== <!--T:33190-->
=== Basic Functions === <!--T:34191-->Returns the first day of a grouping. This function has two variations:
<!--T:35192-->The basic functions are system default functions * With two parameters, the first is the grouping constant from which we want to get the first date (see list above), and implements useful functionalitiesthe second is the base date.
==== Abs ==== <!--T:36193-->Returns the absolute value of a Syntax: FIRST_DAY_OF(<date part>; <base value. date>) SyntaxExamples: ''ABS'FIRST_DAY_OF(<expression>0;DAY_FROM_TODAY(0))''. Accept one parameter and process a numeric data type. ' - Returns the first day of the year from today '''ExamplesFIRST_DAY_OF(1;"Issue Date")''': ABS(Gross Sale-Taxes);First Day of Month Based on ''Issue Date'' Column
==== Avg ==== <!--T:37195-->Returns * With three parameters, the average value of an array of values. Syntax: ''AVGfirst is the grouping constant from which we want to get the first date (<expression1>;<expression2>[;<expression3>;...;<expressionN>]see list above)''. Accept multiple parameter , the second is the date base modifier from today, and process a numeric data type. Can be used the third is the amount to return the average value of different columns from change the same row of a tablemodifier. '''Examples''': AVG(Taxes;Commissions;Costs);
==== Between ==== <!--T:38196-->Check if a value is inside the boundaries of the parameters values. Syntax: ''BETWEEN FIRST_DAY_OF(<expression_to_testdate part>;<expression_bottom_limitdate modifier>;<expression_top_limitdate modifier value>)''. Need three parameters (of any data type, but the three must be from the same type) and returns a boolean, ''true'' if value is inside the boundaries and ''false'' if not. Example: '''Examples''': BETWEENFIRST_DAY_OF("Date"1;'01/01/2013'0;'31/12/2013'-1), BETWEEN("Gross Sales";'0';'1000.00');- first day of current month of last year
==== If then else ==== <!--T:39-->
Tests a boolean expression and returns a value in case it is ''true'' and another in case it is ''false''.
Syntax: ''IF(<expression_test>;<expression_for_true>;<expression_for_false>)''. Need three parameters, a boolean for test and returns any
data type, provided that both are from the same type. Useful for logic tests where two different executions expressions are
needed.
'''Examples''': IF("Branch"=='SOUTH';'South';'Other Branch')
IF("Profit"==0;0;Profit+Taxes);
==== Log LAST_DAY_OF function (Last day of) ==== <!--T:40197-->Returns the log value of a number on a set base. Syntax: ''LOG(<expression_number>[;<expression_base>])''. Minimum one parameter and maximum two. If just one parameters is given, the neperian log is returned. If the second parameter is also given, returns the log in the respective base. '''Examples''': LOG(Profit);
==== Max ==== <!--T:41198-->Returns the greater value between two numbers. Syntax: ''MAX(<expression_value1>;<expression_value2>)''last day of a date grouping. Need This function has two value parameters and returns a value data typevariations. '''Examples''': "Total Value"/MAX("Quantity";"1");
==== Min ==== <!--T:42199-->Returns * With two parameters, the first is the grouping constant from which we want the smaller value between two numbers. Syntax: ''MINlast date (<expression_value1>;<expression_value2>see list above)''. Need two value parameters , and returns a value data typethe second is the base date. '''Examples''': "Total Value"/MIN("Quantity";"1");
==== Pow ==== <!--T:43200-->Returns the power value of a number on a set exponent. Syntax: ''POW LAST_DAY_OF(<expression_numberdate part>[;<expression_exponentbase date>])Examples: '''. Minimum one parameter and maximum two. If the exponent value is not given, use two LAST_DAY_OF(0;DAY_FROM_TODAY(20) by default)''' - Returns the last day of the year from today. '''ExamplesLAST_DAY_OF(1;"Date Issued")''': POW(Value1)+POW(Value1-Value2;3);Last day of month based on ''Date Issued'' column
==== Random ==== <!--T:44202-->Returns a aleatory number inside * With three parameters, the first is the boundaries of grouping constant from which we want the limit values. Syntax: ''RANDOMlast date (<expression_bottom_limit>;<expression_top_limit>see list above)''. Need two parameters, the bottom second is the date base modifier from today, and the upper limit of third is the random number amount to be generatedchange the modifier. '''Examples''': RANDOM(0.0;1.0);
==== Sqrt ==== <!--T:45203-->Returns the square root of a value. Syntax: ''SQRT LAST_DAY_OF(<expressiondate part>;<date modifier>;<date modifier value>)''. Need one parameters, the value to be calculated. Example: '''ExamplesLAST_DAY_OF(1;0;-1)''': SQRT('36').- last day of current month of last year
=== Date Functions = NEW_DATE function (New date) ==== <!--T:46204-->
<!--T:47205-->The Creates a new date functions are operations that use as . It needs three parameters , the first corresponds to the day (between 1 and 31), the second month (between 1 and 12) and return result of the [[Date|third the year. The date data type]]is created from year to day, ie the day must be valid for the month and year (considering 29/02, the year must be leap).
==== Constants list ==== <!--T:48206-->** '''0'''Syntax: DATE_FIELD_YEAR NEW_DATE(Year part<day>;<month>;<year>);** '''1'''Example: DATE_FIELD_MONTH (Month part);** '''2''': DATE_FIELD_DAY NEW_DATE(Day part)1;4;** '''3''': DATE_FIELD_FORTNIGHT DATE_PART(Fortnight part"Issued Date";0);** )'''- Creates the first April day of the year determined by the current row in the '5'Issued Date'': DATE_FIELD_WEEK (Week part);column.
==== Date part NUM_OF_DAYS function (Number of days) ==== <!--T:49207-->Return a part of a date. Syntax: ''DATE_PART(<expression_date>;<constant>)''. Need two parameters, the first is the reference date and the second the constant representing the desired part date: 0, 1, 2, 3 or 5 (see above constants list). '''Examples''': DATE_PART("Order Date";0) - returns the year part of the "Order Date";
==== Day from today ==== <!--T:50208-->Return a backward (negative) or forward (positive) date counting from today. Syntax: ''DAY_FROM_TODAY(<expression_number_days>)''. Need one parameter, Returns the number of days to add or subtractbetween two dates. Therefore you need two dates. '''Examples''': DAY_FROM_TODAY(-1) - returns the yesterday date;
==== First day of ==== <!--T:51209-->Return the first day of a grouping. This function have two variations:* '''First way'''Syntax: Syntax: ''FIRST_DAY_OF NUM_OF_DAYS(<constant_groupingdate 1>;<expression_datedate 2>)''. Need two parameters, the first is the constant grouping in which you want to obtain the first dateExamples: 0, 1, 2, 3 or 5 (see constants list) and the second is the anchor base date. '''Examples''': NUM_OF_DAYS(FIRST_DAY_OF(0;DAY_FROM_TODAY(0)) - first day of year (0"Issued Date") from today (DAY_FROM_TODAY(0)), FIRST_DAY_OF(1;"Order Issued Date") ''' - Returns the number of days from the first day of month (1) the year, based on the "Order Data";* '''Second way'Issued Date'': Syntax: ''FIRST_DAY_OF(<constant_grouping>;<constant_modify_date>;<modify_date_value>)''. Need three parameterscolumn, the first is the constant grouping in which you want to obtain the first date: 0current day, 1, 2, 3 or 5 (see constants list), the second is the modifier of based on the base date from today: 0, 1, 2, 3 or 5 (see constants list) and the third is the amount to change the modifiersame column. '''Examples''': NUM_OF_DAYS(FIRST_DAY_OF(1;0"Issued Date");-LAST_DAY_OF(1;"Issued Date") )''' - first day Returns the number of days of the current month (1) from last year (0;-1);, based on the ''Issued Date'' column.
==== Last day of ==== <!--T:52-->
Return the last day of a grouping. This function have two variations:
* '''First way''':
Syntax: ''LAST_DAY_OF(<constant_grouping>;<expression_date>)''. Need two parameters, the first is the constant grouping in which you
want to obtain the last date: 0, 1, 2, 3 or 5 (see constants list) and the second is the anchor base date.
'''Examples''': LAST_DAY_OF(0;DAY_FROM_TODAY(0)) - last day of year (0) from today (DAY_FROM_TODAY(0)), LAST_DAY_OF(1;"Order Date") -
last day of month (1) based on the "Order Data";
* '''Second way''':
Syntax: ''LAST_DAY_OF(<constant_grouping>;<constant_modify_date>;<modify_date_value>)''. Need three parameters, the first is the
constant grouping in which you want to obtain the last date: 0, 1, 2, 3 or 5 (see constants list), the second is the modifier
of the base date from today: 0, 1, 2, 3 or 5 (see constants list) and the third is the amount to change the modifier.
'''Examples''': LAST_DAY_OF(1;0;-1) - last day of the current month (1) from last year (0;-1);
==== New date NUM_OF_MONTHS function (Number of months) ==== <!--T:53211-->Create an object from a day, month and year. Syntax: ''NEW_DATE(<expression_day>;<expression_month>;<expression_year>)''. Need three parameters, the first is a valid day number (1 to 31), the second for a month (1 to 12) and the third is a year. The date is created from year to day, therefore, the day must be valid for the month and the year (considering 29/02, year must be bissextile). '''Examples''': NEW_DATE(1;4;DATE_PART("Order Date";0)) - create the first day of april from the year determined by the current row "Order Date" column;
==== Num of days ==== <!--T:54212-->Return Returns the number of days months between two dates. Syntax: ''NUM_OF_DAYS(<expression_date1>;<expression_date2>)''. Need Therefore, two date data type parametersare required. '''Examples''': NUM_OF_DAYS(FIRST_DAY_OF(0;"Order Date");"Order Date") - returns the number of days between the first day of year based on the "Order Date" column to the current day of the "Order Date" column, NUM_OF_DAYS(FIRST_DAY_OF(1;"Pay Date"); LAST_DAY_OF(1;"Pay Date")) - returns the number of days of the month of the "Pay Date" column;
==== Num of months ==== <!--T:55213-->Return the number of months between two dates. Syntax: '' NUM_OF_MONTHS(<expression_date1date 1>;<expression_date2date 2>)''. Need two date data type parameters. Example: '''Examples''': NUM_OF_MONTHS(FIRST_DAY_OF(0;"Date");"Date") ''' - Return Returns the number of months between the first day of the year of the "Date" column and the current month of , based on the "''Date" '' column;.
==== Previous date ==== <!--T:56-->
Return the closest exact previous date given a day and month.
Syntax: ''PREVIOUS_DATE(<expression_day>;<expression_month>)''. Need two parameters, the first is the day of month and the second the
month.
'''Examples''': PREVIOUS_DATE(1;4) - return the closest ''01/04'', in other words, until "01/04/current year", returns "01/04/last year",
after that returns "01/04/current year".
==== PREVIOUS_DATE function (Previous date) ==== <!--T:214-->
=== Special variables === <!--T:57215-->Given a day and a month, returns the last occurrence of that date. That is, if the current date (today) is less than the date passed by parameter (day / month), the return is the date (passed by parameter) of the previous year. Otherwise the return will be the current year date.
<!--T:58216-->Special variables can Syntax: PREVIOUS_DATE(<day>; <month>)Examples: '''PREVIOUS_DATE(15;12)''' - Considering that today's date is 14/11/2019, the last time December 15th occurred relative to today's date was 15/12/2018, so this will be use with the expressionsreturn.
<!--T:59-->
@count - Total number of lines returned in a table.
== Special Variables == <!--T:60217-->@row - current line number.
<!--T:61218-->@sum[Column] - Sum of indicated columnThey can be used in conjunction with expressions to create complex calculations.Must be used in double quotation marks (“)
<!--T:62-->
@avg[Column] - Avg of indicated column like @sum[Column] / @count
<!--T:219-->
* '''"@count"''' - Total number of rows that were returned for the component.
* '''"@row"''' - Current row number
* '''"@sum[column]"''' - Sum of the indicated column.
** Example: ''"@sum[Price]"'' - returns the sum of all rows in the ''Price'' column.
* '''"@avg[column]"''' - Average column, similar to ''"@sum[column]"'' / ''"@count"''
* '''"@prev[column]"''' - Row value before current row for this column
* '''"@totalRowValue[column]"''' - Value of total row, (if present), from this column.
* '''"@accumCol[column]"''' - Cumulative value from column to current row. Useful for calculating variable mean.
** Example: ''"@accumCol[column]"'' / ''"@row"''
</translate>