Changes

Jump to: navigation, search

Expressions/en

1,237 bytes added, 02:26, 5 October 2022
Updating to match new version of source page
<div class="index-right">__TOC__</div>
You can create expressions (formulas) directly in the dashboard components. It can thus display calculated values that are not present in the data source datasource file/spreadsheet.
We just remember that currently TaticView only supports expressions whose numeric return.
 
Expressions support the backslash as [[EscapeChar|escape character]] so that names can contain the delimiting characters.
Below are details about how the expressions work:
== Basic structure of a Expression (Formula) ==
==== Identifier ====
 
It is the name of the field or column involved in the expression, it must be delimited by double quotes.
 
* Examples: "Average Price". "Screw 1\" philips", "Seler"
==== Value Operand ====
* Example: IF("Product" == "#null";0;20)
 
== Arithmetic Expressions ==
'''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 ====
 
Returns number of occurrences (lines) for column or value.
 
By now this functions works only at Datasource expressions
 
Syntax:
COUNT(<expression>)
Example:
'''COUNT("Product")''' - Returns number of occurrences (lines) of products
 
==== COUNT_DISTINCT function ====
 
Returns number of unique occurrences (lines) for column or value.
 
By now this functions works only at Datasource expressions
 
Syntax:
COUNT_DISTINCT(<expression>)
Example:
'''COUNT_DISTINCT("Product")''' - Returns number of unique (different) occurrences (lines) of products
==== IF ELSE function (If .... Otherwise ...) ====
'''RANDOM(10;100)''' - Returns a random number between ''10'' and ''100''
==== ROUND function ====
 
Returns the rounded value of a value column or value.
 
Syntax:
ROUND(<value>;<precision>)
Example:
'''ROUND("Profit")''' - If Profit 10.38 returns 10.00
'''ROUND(15.65)''' - Returns 16.00
'''ROUND(1.777;1)''' - Returns 1.8
==== SQRT function (Square Root) ====
Example:
'''LIKE("Product"; '%anh%')''' - Returns true if the ''Product'' contains the term ''anh'' or false otherwise
 
== Date Functions ==
* '''"@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"''
11,677
edits

Navigation menu