Expressions allows to manually create and edit [[Filters]] rules by using programming language. <div class="index-right">__TOC__</div>
'''Important''': After manually editing the expression, You can create expressions (formulas) directly in the regular operators dashboard components. It can thus display calculated values that are not be used until you ''Clear All'' present in the filters;data source file/spreadsheet.
__TOC__To create the expression (formula) in the components, the component must support the addition of the special column ''Expression (Formula)''.
== Basic Expression Structures ==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.
=== Value Operands ===In addition, it is also possible to use fixed numbers and texts in the case of comparative expressions.
The value operands are values from a [[Columns Data Type|data type]] that are used in expressions as variables.
Expression Example:
==== Value type operand ====Are numeric values of * If the float type (Real numbers domain). These values allow component has the use of an integer columns ''Total Price'' and a fraction part''Quantity'', separated by you can create an expression to calculate the dot (.) character (decimal separator)''Unit Price''. Would be like this: ** ''Total Price'Examples'/ '': 1Quantity''* In addition, 1.05you can use fixed values, 2.55;such as:** ''Total price'' / 10
==== Text type operand ====
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 ====Are values We just remember that express any datecurrently TaticView only supports expressions whose numeric return. 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 ====
Are values from the ''true'' or ''false'' kind. Usually used to validate or not a condition.
'''Examples''': true e false;
==== Identifier type operand ====Are values that represents a field or variable in Below are details about how the expression. Used to make reference to data source columns, delimited by double quotes ("). '''Examples'''expressions work: "City.City", "Product.Product";
==Basic structure of a Expression (Formula) == Parenthesis ====Used to group and separate expressions parts. Expressions inside parenthesis are processed first. '''Examples''': ("Profit" / "Total Price" ) + 10
==== System variable type operand ====
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.
==== Value Operand ====
It's the numerical values. You can use both while values and decimal values. For decimal values, the decimal separator should be the point. * Examples: 1, 1.05, 2.55 ==== Text Operand ==== 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 ('). * Examples: 'John Snow', 'California', 'Spaghetti' ==== Date Operand ==== 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. * Examples: '01/01/2019', '14/11/2019', '25/12/2019' ==== Boolean Operand ==== They're operators of the true or false type. Normally user to validate, or not, a condition in a more complex expression. * Examples: true, false ==== Parentheses ==== Used to group and separate parts of on expression. Expressions within parentheses are processed first. * Example: ("Profit"/"Total Price") + 10 ==== System variable Operand ==== These are predefined variables in the system. To use the system variables you must precede them by hashtag (#) and delimit them by double quotes("). Currently only the "#null" variable is available and indicates null content. * Example: IF("Product" == "#null";0;20) == Arithmetic Expressions === 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.
The arithmetic expressions relate two operands (value or another expression) to compose a sum, subtraction, multiplication or division.
==== Sum (+) ====
Sum Add two value operandsor another expression result. Represented by the sum (''+) character'' charecter. Syntax: '' <operand/operating or expressionresult> '''+ ''' <operand/operating or expressionresult>''. Example: '''Examples''': "Taxes" + "Commissions";''' - Sums the values of the fields ''Taxes'' and ''Commissions''
==== Subtraction (-) ====
Subtract two value operandsor another expression result. Represented by the subtract or hyphen (''-) character'' charecter. Syntax: '' <operand/operating or expressionresult> '''- ''' <operand/operating or expressionresult>''. Example: '''Examples''': "Gross SalePrice" - "Taxes";''' - Subtracts the values from the ''Price'' and ''Taxes'' fields.
==== Multiplication (*) ====
Multiplicate two operands. Represented by the multiplication or star (*) character.
Syntax: ''<operand/expression> * <operand/expression>''.
'''Examples''': "Amount" * "Unit Price";
Multiplies two value operands or another expression result. Represented by the multiplication charecter ''*''. 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(/) ====Divides Divide two value operandsor another expression result. Represented by the divide or bar (division charecter ''/) character''. Syntax: '' <operand/operating or expressionresult> '''/ ''' <operand/operating or expressionresult>''. Example: '''Examples''': "Total ValuePrice" / "AmountQuantity"''' - Divides the value of the ''Price'' field by the value of the ''Quantity'' field. == Relational Expressions == 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 (==) ====
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 ''=== Relational Expressions ===''.
The relational expressions compare two operands (value Syntax: <operating or another expression) to evaluate if a condition is result> '''=='true'' <operating or expression result>Example: '''falseIF("Product" == "#null";0;20)''. Usually used with decision functions' - If the ''Product'' is null, like return the value ''IF0''.Otherwise return the value ''20''
==== Equal (==) ====
Performs the equal comparison expression between two operands. Represented by the equal operator (==).
Syntax: ''<expression> == <expression>''.
'''Examples''': "Unit Price" == "Total Price";
==== Different (!=) ====
Performs the different comparison expression between It compare if two operandsare different, returning true if they were different or false if equal. Represented by the different differente operator (''!=)''. Syntax: '' <operating or expressionresult> '''!= ''' <operating or expressionresult>''.Example: '''Examples''': IF("City.CityProduct" != 'New YorkLasagna';0;20)''' - If the ''Product'' is different from ''Lasagna'', return the value ''0''. Otherwise return the value ''20''
==== Greater than (>) ====
Return ''true'' if 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';
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 ''>''. 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 than to (>=) ====Return ''true'' Compares if the first expression operator (from the left) is greater than or equal to the second expression operator (from the right), returning true if it is greater or equal and ''false'' otherwiseif it is lesser. Represented by the greater or equal operator ''>=''. 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 (<) ==== 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 ''<''. Syntax: <operating or expression result> '''<'''<operating or expressionresult> Example: '''IF("Gross Value" < 100;50;200)''' - If ''Gross Value'' is less than ''100'', returns ''50'' if not ''200'' ==== Less or equal to (<=) ==== 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 ''<=''. Syntax: <operating or expression result>'''<= ''' <operating or expressionresult>Example: '''IF("Gross Value" <= 500;100;0)''' - If ''Gross Value'' is less than or equal to ''500'' returns ''100'', if not ''0'' == Logical Expressions == 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 (&&) ==== 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. Syntax: <expression> && <expression>Examples: ''': IF(("Order DatePrice" >0) && ("Seller" == '01/01/2011John Snow');450;0)''' - If ''Price'' is greater than ''0'' '''AND''' ''Seller'' is equal to ''John Snow'', returns ''450'' if not returns ''0'' '''IF(("Order DateCity"!= "#null") && ("Product" != 'Lasagna');1;0);''' - If ''City'' is non-null '''AND''' ''Product'' is different from ''Lasagna'' returns ''1'' if it does not return ''0''
==== Lesser than Or Operator (<||) ====Return ''true'' if the first expression is lesser than the second expression and ''false'' otherwise. Represented by the lesser operator (<). Syntax: ''<expression> < <expression>''. '''Examples''': "Profit" < '0';
==== Lesser or equal than (<=) ====Return Performs the logical ''trueOR'' if operation between two Boolean values. A two values must be true so that the first expression result of the operation is lesser than or equal to the second expression and ''false'' otherwisetrue. Represented by the lesser or equal operator (<=). Syntax: ''<expression> <= <expression>''. '''Examples''': IF("Order Date" <= ||'01/01/2011';"Order Date";0).
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" !== Logical Expressions ==='Lasagna');1;0)''' - If ''City'' is non-null '''OR''' ''Product'' is different from ''Lasagna'' returns ''1'' if it does not return ''0''
The logical expressions group two operands (boolean type or another expression) to compose a logic expression, with the objective to evaluate two boolean operands relation into a ''true'' or ''false'' result. Usually used with decision functions, like the ''IF'', and with relational expressions.
==== And Denial Operator (&&!) ====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 (||) ====Performs the logical negation operation ''OR'' between two for a boolean valuesvalue. One of the two operands must be ''true'' for If the result of the operation is true the negation operator converts to be ''true''false and vice versa. Represented by the ''OR'' operator (||). Syntax: ''<expression> || <expression>!''. '''Examples''': IF((Gross Sales > '0') || (Sold == 'true');'Sold';'Not Sold'), IF((City!="#null") || (Date<DAY_FROM_TODAY(0));1;0);
==== Not (Syntax: !) ====<expression>Example:Performs the denial logical operation for a boolean value. If the operand are ''true'IF(!BETWEEN("Delivery Date"; ' the 01/01/2015'; 'NOT31/12/2015');2016;2015)' convert it to ''false'' (and the other way around). Represented by - If the ''NOT'' operator (!). Syntax: Delivery Date''! <expression>is ''. 'NOT''Examples'between '': IF(!BETWEEN("Date", '01/01/20132015'' and ', '12/31/12/20132015'');returns 'Not 2013';2016'2013').If between this period returns ''2015''
== Auxiliary Functions ==
Basic helper functions are standard system functions and implement useful features for composing complex expressions. ==== ABS function ==== Function that returns the absolute numeric value of a base numeric value. Syntax: ABS(<value operator or expression>)Example: '''ABS("Price" / "Quantity")''' - Returns the absolute value of ''Price'' divided by ''Quantity'' ==== AVG function ==== 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. 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 ==== Checks whether a value is within the limits of the parameters used. Return true or false. 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 ==== IF ELSE function (If .... Otherwise ...) ==== 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. 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'' ==== LOG function ==== Returns the logarithm of a number on a defined basis. It can be used with only one parameter, in this case the neperian (natural) logarithm is used . If two parameters are used, the second server to inform the base to be used by the logarithm. 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'' ==== MAX function ==== Returns the largest value between two values. Syntax: MAX(<expression 1>;<expression 2>)Example: '''"Value" / MAX("Quantity";1)''' - Divides ''Value'' by the largest value between ''Quantity'' and ''1'' ==== MIN function ==== Returns the smallest value between two values. Syntax: MIN(<expression 1>; <expression 2>)Example: '''"Value" / MIN("Cost"; 100)''' - Divides ''Value'' by the smallest value between ''Cost'' and ''100'' ==== POWER function ==== Basic Returns the power of a value in a defined exponent. It can be used with only one parameter, in this case it considers the default exponent 2. If a second parameter is passed, this will be the exponent. Syntax: POW(<expression>; <exponent>)Examples: '''POW("Profit")''' - Returns the power of the ''Profit'' value. '''POW("Cost"; 3)''' - Returns the power of the ''Cost'' value, raised to ''3'' ==== RANDOM function ==== Returns a random number within the range of values passed as arguments. Syntax: RANDOM(<start limit>; <end limit>)Example: '''RANDOM(10,100)''' - Returns a random number between ''10'' and ''100'' ==== SQRT function (Square Root) ==== Returns the square root of a value. Syntax: SQRT(<value or expression>)Examples: '''SQRT("Profit")''' - Returns the square root of the value ''Profit'' '''SQRT(81)''' - Returns the square root of ''81'' ==== LIKE function ==== Returns true if the desired content is found in the list and false otherwise. It needs two parameters, the first is the data to query and the second is the term to be found. Remembering that it is necessary to use the wildcard operator “%” and surround the term by single quotation mark. Syntax: LIKE(< data>; <term>)Example: '''LKE("Product"; '%anh%')''' - Returns true if the ''Product'' contains the term ''anh'' or false otherwise == Date Functions == Date functions are operations that take a date as a parameter and also return a date. There are some constants to assist in using date functions, they are: * 0: ''DATE_FIELD_YEAR'' (Part of the year)* 1: ''DATE_FIELD_MONTH'' (Month Part)* 2: ''DATE_FIELD_DAY'' (Daypart)* 3: ''DATE_FIELD_FORTNIGHT'' (Part of fortnight)* 5: ''DATE_FIELD_WEEK'' (Part of the Week) ==== DATE_PART function (Date Part) ==== 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. Syntax: DATE_ PART(<date>; <constant representing which part>)Example: '''DATE_ PART("Issued Date"; 0)''' - Returns the year portion of the ''Issued Date'' ==== DAY_FROM_TODAY function (Days from today) ==== Returns a days count backward (negative) or forward (positive) from today. You need a parameter that indicates the number of days to add or subtract. Syntax: DAY_FROM_TODAY(<number of days>)Example: '''DAY_FROM_TODAY(-1)''' - Returns yesterday's date ==== FIRST_DAY_OF function (First day of) ==== Returns the first day of a grouping. This function has two variations: * With two parameters, the first is the grouping constant from which we want to get the first date (see list above), and the second is the base date.
The basic functions are system default functions and implements useful functionalities.Syntax: FIRST_DAY_OF(<date part>; <base date>)Examples: '''FIRST_DAY_OF(0;DAY_FROM_TODAY(0))''' - Returns the first day of the year from today
==== Abs ====Returns the absolute value of a base value. Syntax: '''ABSFIRST_DAY_OF(<expression>1;"Issue Date")''. Accept one parameter and process a numeric data type. '- First Day of Month Based on ''ExamplesIssue Date''': ABS(Gross Sale-Taxes);Column
==== Avg ====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 change the average value of different columns from the same row of a tablemodifier. '''Examples''': AVG(Taxes;Commissions;Costs);
==== Between ====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";'01/01/2013';'31/12/2013')1, BETWEEN("Gross Sales";'0,-1)';'1000.00');- first day of current month of last year
==== If then else ====
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) ====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 ====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 ====Returns * With two parameters, the first is the smaller value between two numbers. Syntax: ''MINgrouping constant from which we want the last 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 ====Returns the power value of a number on a set exponent. Syntax: ''POW LAST_DAY_OF(<expression_numberdate part>[;<expression_exponentbase date>])''. Minimum one parameter and maximum two. If the exponent value is not given, use two (2) by default. Examples: '''ExamplesLAST_DAY_OF(0;DAY_FROM_TODAY(0))''': POW(Value1)+POW(Value1-Value2;3);Returns the last day of the year from today.
==== Random ====Returns an aleatory number inside the boundaries of the limit values. Syntax: '''RANDOMLAST_DAY_OF(<expression_bottom_limit>1;<expression_top_limit>"Date Issued")''. Need two parameters, the bottom and the upper limit ' - Last day of the random number to be generated. month based on ''Date Issued'Examples''': RANDOM(0.0;1.0);column
==== Sqrt ====Returns * With three parameters, the first is the grouping constant from which we want the square root of a value. Syntax: ''SQRTlast date (<expression>see list above)''. Need one parameters, the value second is the date base modifier from today, and the third is the amount to be calculated. '''Examples''': SQRT('36')change the modifier.
==== Like ====Returns true if the desired content is found in the list and false if the content is not found. Syntax: ''LIKE LAST_DAY_OF(<data_setdate part>;<date modifier>;<patterndate modifier value>)''. Needs two parameters, the first is the set of data that will be queried. The second is the term one wishes to find, in the data set. Returns true or false.Example: '''Examples''': LIKELAST_DAY_OF("Product";'%ghe%'1,0,-1). Returns true if in the ''Product'' dataset there is some containing ''gue''. Otherwise, returns false.- last day of current month of last year
=== Date Functions ===
The ==== NEW_DATE function (New date functions are operations that use as parameters and return the result of the [[Date|date data type]].) ====
==== Constants list ====** '''0''': DATE_FIELD_YEAR Creates a new date. It needs three parameters, the first corresponds to the day (Year part);** '''between 1''': DATE_FIELD_MONTH (Month partand 31);** '''2''': DATE_FIELD_DAY , the second month (Day part);** '''3''': DATE_FIELD_FORTNIGHT (Fortnight partbetween 1 and 12);** '''5''': DATE_FIELD_WEEK and the third the year. The date is created from year to day, ie the day must be valid for the month and year (Week partconsidering 29/02, the year must be leap);.
Syntax:
NEW_DATE(<day>;<month>;<year>)
Example:
'''NEW_DATE(1;4;DATE_PART("Issued Date";0))''' - Creates the first April day of the year determined by the current row in the ''Issued Date'' column.
==== Date part ====
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 NUM_OF_DAYS function (Number of days) ====Return a backward (negative) or forward (positive) date counting from today. Syntax: ''DAY_FROM_TODAY(<expression_number_days>)''. Need one parameter, the number of days to add or subtract. '''Examples''': DAY_FROM_TODAY(-1) - returns the yesterday date;
==== First day of ====Return Returns the first day number of a grouping. This function has days between two variations:* '''First way''': Syntax: ''FIRST_DAY_OF(<constant_grouping>;<expression_date>)''dates. Need Therefore you need two parameters, the first is the constant grouping in which you want to obtain the first date: 0, 1, 2, 3 or 5 (see constants list) and the second is the anchor base datedates. '''Examples''': FIRST_DAY_OF(0;DAY_FROM_TODAY(0)) - first day of year (0) from today (DAY_FROM_TODAY(0)), FIRST_DAY_OF(1;"Order Date") - first day of month (1) based on the "Order Data";* '''Second way''': Syntax: ''FIRST_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 first 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''': FIRST_DAY_OF(1;0;-1) - first day of the current month (1) from last year (0;-1);
==== Last day of ====Return the last day of a grouping. This function has two variations:* '''First way'''Syntax: Syntax: ''LAST_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 last dateExamples: 0, 1, 2, 3 or 5 (see constants list) and the second is the anchor base date. '''Examples''': LAST_DAY_OFNUM_OF_DAYS(FIRST_DAY_OF(0;DAY_FROM_TODAY(0)) - last day of year (0) from today (DAY_FROM_TODAY(0"Issued Date")), LAST_DAY_OF(1;"Order Issued Date") ''' - last Returns the number of days from the first day of month (1) the year, based on the "Order Data";* '''Second way''': Syntax: ''LAST_DAY_OF(<constant_grouping>;<constant_modify_date>;<modify_date_value>)Issued Date''. Need three parameterscolumn, the first is the constant grouping in which you want to obtain the last date: 0, 1, 2, 3 or 5 (see constants list)current day, based on 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 modifiersame column. '''Examples''': LAST_DAY_OF(1;0;-1) - last day of the current month (1) from last year (0;-1);
==== New date ====Create an object from a day, month and year. Syntax: '''NEW_DATENUM_OF_DAYS(<expression_day>;<expression_month>;<expression_year>)''. Need three parameters, the first is a valid day number FIRST_DAY_OF(1 to 31;"Issued Date"), the second for a month ;LAST_DAY_OF(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 Issued Date";0)) ''' - create Returns the first day number of days of april from the year determined by month, based on the current row "Order ''Issued Date" '' column;.
==== Num of days ====
Return the number of days between two dates.
Syntax: ''NUM_OF_DAYS(<expression_date1>;<expression_date2>)''. Need two date data type parameters.
'''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 NUM_OF_MONTHS function (Number of months ) ====Return the number of months between two dates. Syntax: ''NUM_OF_MONTHS(<expression_date1>;<expression_date2>)''. Need two date data type parameters. '''Examples''': NUM_OF_MONTHS(FIRST_DAY_OF(0;"Date");"Date") - Return the number of months between the first day of the year of the "Date" column and the current month of the "Date" column;
==== Previous date ====Return Returns the closest exact previous date given a day and monthnumber of months between two dates. Syntax: ''PREVIOUS_DATE(<expression_day>;<expression_month>)''. Need Therefore, two date 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"are required.
Syntax:
NUM_OF_MONTHS(<date 1>; <date 2>)
Example:
'''NUM_OF_MONTHS(FIRST_DAY_OF(0; "Date"); "Date")''' - Returns the number of months between the first day of the year and the current month, based on the ''Date'' column.
==== Special variables ====
Special variables can be used with the expressions.==== PREVIOUS_DATE function (Previous date) ====
'''Important:''' The variables below must 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 enclosed in double quotation marksthe current year date.
@count Syntax: PREVIOUS_DATE(<day>; <month>)Examples: '''PREVIOUS_DATE(15;12)''' - Total number of lines returned in a tableConsidering 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 the return.
"@row" - current line number.
"@sum[Column]" - Sum of indicated column.== Special Variables ==
"@avg[Column]" - Avg of indicated column like @sum[Column] / @countThey can be used in conjunction with expressions to create complex calculations. Must be used in double quotation marks (“)
"@prev[column]" - Previous row column value
* '''"@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* '''"@accumCol[column] "''' - Current accumulated Cumulative value from column valueto current row. Useful to calculate Variable Avg (for calculating variable mean.** Example: ''"@accumCol[column]" '' / ''"@row")''