Equation Functions
29 min
equation tools the equation editor docid\ gn6iymydusl3xm94xvkw helps you use function and gives you previews of the results the equation selector docid\ lqzs2uvaurufgbmil1gql helps you choose a function to work with list of equation functions by category date and time function description date returns the date of the given year, month, and day datespan can be added to a date to offset it now returns the current date and time formatted as a date and time time returns the time of the given hour, minute, and second timespan can be added to a time to offset it math and trig function description abs returns the absolute value of a number, a number without a sign power returns the result of a number raised to a power sum adds all the numbers in a range of values statistical function description average returns the average (arithmetic mean) of its arguments, which can be numbers of names, arrays, or reference that contain numbers count counts the number of values in a range that contains numbers max returns the largest value in a set of values ignores logical values and text min returns the smallest value in a set of values ignores logical values and text database function description data returns a dataset using the text datedata returns a date type dataset using the text, using input as the date format null returns a null value primarily used to compare against the value of data value return a number converted from text text function description contains returns whether one text string contains another text string indexof returns the first index of one text string within another text string lastindexof returns the last index of one text string within another text string mid returns the characters from the middle of a text string, given a starting position and length substring returns the characters from the middle of a text string, given a starting position and an ending position trim returns the text with the whitespace removed from the beginning and the end upper returns the text with all letters in uppercase lower returns the text with all letters in lowercase len returns the length of the text logical function description false returns the logical value false if checks whether a condition is met, and returns one value if true, and another value if false true returns the logical value true list of equation functions abs function description the abs function takes the absolute value of a number (the same number without a sign) for example \=abs( 3) would return 3 syntax abs(number) number required the number to take the absolute value of average function description the average function returns the average (arithmetic mean) of its arguments, which can be numbers of names, arrays, or references that contain numbers for example, \=average(4,2,3) would return 3 if the average is not an integer, you will get a long decimal number use the 'display' attribute in an out tag to set how many digits to display syntax average(number1,number2, ) number at least one is required these are the values to average contains function description the contains function returns whether one text string contains another text string for example, \=contains("this is a test string ", "test") would return true syntax contains(within text,find text) within text required the text containing the text you want to find find text required the text you want to find count function description the count function returns the count of the number of values in a range that contains numbers for example, \=count(4,2,3) would return 3 syntax count(number1,number2, ) number at least one is required these are the values to count data function description the data function returns a dataset from a data source for example, \=data("select dbo categories categoryname from dbo categories") when using the sql northwind database would return "beverages" note that this is heavily dependent on the data source you are reading from syntax data(text) text required the query string to use against the data source datedata function description the datedata function returns a date type dataset from a data source it uses a pattern that is passed to simpledateformat (see java documentation) to read in non standard or un typed date data note that this is heavily dependant on the data source you are reading from syntax datedata(text,input) text required the query string to use against the data source input required the pattern to be passed to simpledateformat to read in the data date function description the date function returns the date of the given year, month, and day for example, \=date(2010,1,2) represents january 2, 2010 there are two major uses you need a date object to add a datespan (you want to offset a date by a number of years, months, and/or days) you want to use the blueprint tag 'format' attribute to output the date in a specific format syntax date(year,month,day) year required the year for the specific date month required the month for the specific date day required the day for the specific date datespan function description the datespan function represents a time span for example, \=datespan(3,2,1) represents a timespan of 3 years, 2 months, and 1 day there is one major use can be added to a date to provide an offset of a given number of years, months, and/or days a date can be obtained using the date, data, and datedata functions syntax date(year,month,day) year required the number of years to span month required the number of months to span day required the number of days to span false function description the false function returns the logical value false this can used in comparisons for example, \=(1 == 2) = false() would return true syntax false() if function description the if function checks whether a condition is met if true, it returns one value if false, it returns another value for example, \=if(1==2, "one equals two ", "one does not equal two ") would return "one does not equal two" syntax if(logical test,value if true,value if false) logical test required any value of expression that can evaluated to true or false value if true required the value that is returned if logical text is true value if false required the value that is returned if logical text is false indexof function description the indexof function returns the first index of one text string within another text string for example, \=indexof("this rocks ", "is") would return 2 syntax indexof(within text,find text) within text required the text containing the text you want to find find text required the text you want to find lastindexof function description the lastindexof function returns the index of the last occurance of one text string within another text string for example, \=lastindexof("this is great ", "is") would return 5 "is" can be found at both index 2 and 5, bit 5 is later in the string so 5 is returned syntax lastindexof(within text,find text) within text required the text containing the text you want to find find text required the text you want to find len function description the len function returns the length of the text for example, \= len("some text") returns the number 9 syntax len(text) text required the string whose length you wish to know lower function description the lower function returns the text with all letters in lowercase for example \=lower("this is some text") returns "this is some text" syntax lower(text) text required the text to convert to lowercase max function description the max function returns the largest value in a set of values, ignoring logical values and text for example, \=max(4,2,3) would return 4 syntax max(number1,number2, ) number at least one is required these are the values to find the maximum of mid function description the mid function returns the characters from the middle of a text string, given a starting position and length for example, \=mid("this is a text ", 3, 5) would return "is is" syntax mid(text,start num,num chars) text required the text from which you want to extract characters start num required the position of the first character you want to extract the first character in text is 1 (note this is different from substring) num chars required this specifies how many characters to return from text min function description the min function returns the smallest value in a set of values, ignoring logical values and text for example, \=min(4,2,3) would return 2 syntax min(number1,number2, ) number at least one is required these are the values to find the minimum of now function description the now function returns the current date and time note that this is evaluated when the report is generated, not when the tag is created this can be added to a datespan or timespan syntax now() null function description the null function returns a null value this can then be compared against a value returned for data or datedata syntax null() power function description the power function returns a number raised to a power for example, \=power(4,2) would return 4 taken to the second power (16) syntax power(number,power) number required this is the base number power required this is the exponent, to which the base number is raised substring function description the substring function returns the characters from the middle of a text string, given a starting position and an ending position for example, \=substring("this is a test ",0,4) would return "is" syntax substring(text,start num,end num) text required the text from which you want to extract characters start num required the position of the first character you want to extract the first character in text is 0 (note this is different from mid) end num optional this specifies the position of the last character you want to extract sum function description the sum function adds all the numbers in a range of values for example, \=sum(4,2,1, 1) would return 6 syntax sum(number1,number2, ) number at least one is required this is the value to sum time function description the time function returns the time of the given hour, minute, and second for example, \=time(14,5,0) represents 2 05pm there are two major uses you need a time object to add a timespan (you want to offset a time by a number of hours, minutes, and/or seconds) you want to use the blueprint tag 'format' attribute to output the date in a specific format syntax time(hour,minute,second) hour required the hour for the specific time minute required the minute for the specific time second required the second for the specific time timespan function description the timespan function represents a time span for example, \=timespan(3,2,1) represents a timespan of 3 hours, 2 minutes, and 1 second there is one major use can be added to a time to provide an offset of a given number of hours, minutes, and/or seconds a time can be obtained using the time, data, and datedata functions syntax timespan(hours,minutes,seconds) hours required the number of hours to span minutes required the number of minutes to span seconds required the number of seconds to span trim function description the trim function returns the text with the whitespace removed from the beginning and the end for example, \=trim(" this is a test ") would return "this is a test" syntax trim(text) text required the text from which you want remove starting and ending whitespace true function description the true function returns the logical value true this can used in comparisons for example, \=(1 == 2) = true() would return false syntax true() upper function description the upper function returns the text with all letters in uppercase for example, \=upper("this is some text") returns "this is some text" syntax upper(text) text required the text to convert to uppercase value function description the value function returns a number from text for example, \=value("100") converts the text "100" into the number 100 the number can then be used in arithmetic and aggregations functions, as well as comparisons with other numbers syntax value(text) text required the text value to convert to a number