Introduction
The Pierce Application Core (PAC) is included in the County’s modern custom-developed applications including Legal Information Network Exchange (LINX), PALS Plus, Forensic Death Information System (FDIS), Person, School Threat System (STS) and IDPPOP.
PAC Components
PAC includes the following powerful configuration components that enable a power user to tailor an application to meet the needs of the users.
Conditions
Expressions
Definition
Expressions are made up of functions that use values, variables, or other functions.
Values
Values may be text or numbers.
“Pierce County” 987 444.03 There are two special text values.
“true” in lower case letters may be used in place of the Boolean true. “false” in lower case letters may be used in place of the Boolean false.
Example:
HTMLLINK(“Pierce County”, “http://www.piercecountywa.org/”, “_blank”)
Variables
Variables are data source properties that have been included in a query.
person.firstName person.lastName
Example:
CONCATENATE(person.firstName, person.lastName)
Functions
Functions are a way to make a new value from existing values, variables, and/or function results.
Example:
DAYOFYEAR(NOW())
Combination
A mix of values, variables, and functions may be used.
Example:
DATEFORMAT(NOW(), “dd/MM/YYYY”, “UTC”, “America/Los_Angeles”)
Nesting
Expressions may be nested.
Example: NOW function is nested in the DATEADD function which is nested in the DATEDIFF function.
DATEDIFF(“Days”,NOW(),DATEADD(1,”YEAR”,NOW()))
Supported Functions
Date and Time
Function | Description | Example |
---|---|---|
CURRENTTIMEMILLIS |
Calculate the difference, measured in milliseconds, between the current time and midnight on January 1, 1970 UTC. |
CURRENTTIMEMILLIS()
Say today was Jan 6th, 2017 at 21:21:55, CURRENTTIMEMILLIS() would be 1483737715213 |
DATEADD |
Create a new date by adding to an existing date. |
DATEADD(number, datepart, date)
Say today was Dec 25th, 2017, DATEADD(1, “YEAR”, NOW()) would be Dec 25th, 2018 |
DATECREATE |
Create a date from a day, month, and year. |
DATECREATE(day, month, year)
DATECREATE(22, 1, 1975) would be January 22nd, 1975 |
DATEDIFF |
Calculate the difference between two dates. |
DATEDIFF(unit-of-measure, first-date, second-date)
Say today was Apr 4th 2012, DATEDIFF(“Days”, NOW(), DATEADD(1, “year”, NOW())) would equal 365 Say today was Feb 1st 2012, DATEDIFF(“days”, NOW(), DATEADD(1, “YEAR”, NOW())) would equal 366 |
DATEFORMAT |
Format a date as text. |
DATEFORMAT(date, format, optional-existing-time-zone, optional-convert-to-time-zone)
Say today was Apr 14th, 2007, DATEFORMAT(NOW(), “dd/MM/YYYY”) would be 14/04/2007 Say today was Jul 9th, 2016, DATEFORMAT(NOW(), “dd/MM/YYYY”, “UTC”, “America/Los_Angeles”) would change today’s UTC date appear as 09/07/2016 and be PDT time zone |
DATEPARSE |
Using a text format pattern, create a date from text. |
DATEPARSE(format, text-date)
DATEPARSE(“MM/dd/yyyy”,”1/22/1975″) would create a date of Wed Jan 22 00:00:00 PST 1975 DATEPARSE(“M/d/yy h:m”,”1/22/75 3:59″) would create a date of Wed Jan 22 03:59:00 PST 1975 DATEPARSE(“h:m”, “3:59”) would create a date of Thu Jan 01 03:59:00 PST 1970 |
DATEPART |
Get the year, month, or day from a date. |
DATEPART(date, datepart)
Say today was Dec 31st, 1999, DATEPART(NOW(), “year”) would be 1999 |
DAYNAME |
Get the day name (Monday, Tuesday, Wednesday, …) of a date. |
DAYNAME(date)
Say today was Apr 28th, 2014, DAYNAME(NOW()) would be Monday |
DAYOFMONTH |
Get the day (1 – 31) of the date. |
DAYOFMONTH(date)
Say today was Apr 28th, 2014, DAYOFMONTH(NOW()) would be 28 |
DAYOFWEEK |
Get the day (1 – 7 Sunday being 1) of the week from a date. |
DAYOFWEEK(date)
Say today was Apr 28th, 2014, DAYOFWEEK(NOW()) would be 2 |
DAYOFYEAR |
Get the day (1 – 356 or 366) of the year from a date. |
DAYOFYEAR(date)
Say today was Feb 13th, 1983, DAYOFYEAR(NOW()) would be 44 |
HOUR |
Get the hour (0 – 11) of the date. |
HOUR(date)
Say the time was 12:56 am, HOUR(NOW()) would be 0 Say the time was 2:56 pm, HOUR(NOW()) would be 2 |
HOUROFDAY |
Get the hour of the day (0 – 23) of the date. |
HOUR(date)
Say the time was 11:56 pm, HOUROFDAY(NOW()) would be 23 Say the time was 2:56 pm, HOUROFDAY(NOW()) would be 14 |
MINUTE |
Get the minute (0 – 59) of the date. |
MINUTE(date)
Say the time was 11:56 pm, MINUTE(NOW()) would be 56 |
MONTH |
Get the month (1 – 12) of the date. |
MONTH(date)
Say today was Feb 13th, 1983, MONTH(NOW()) would be 2 |
MONTHNAME |
Get the month name from the date or from the month number (1 – 12). |
MONTHNAME(date)
Say today was Feb 13th, 1983, MONTHNAME(NOW()) would be February MONTHNAME(2) would be February |
NOW |
Get the current date/time. |
NOW()
Say today was Jan 6th, 2017 at 21:21:55, NOW() would be Jan 6th, 2017 at 21:21:55 |
QUARTER |
Get the quarter (1 – 4) of the date. |
QUARTER(date)
Say today was Oct 31st, 2004, QUARTER(NOW()) would be 4 |
SECOND |
Get the second (0 – 59) of the date. |
SECOND(date)
Say the time was 11:56:09 pm, SECOND(NOW()) would be 9 |
WEEKOFMONTH |
Get the week (1 – 6) of the month from a date. |
WEEKOFMONTH(date)
Say today was Jul 4th, 2011, WEEKOFMONTH(NOW()) would be 2 |
WEEKOFYEAR |
Get the week (1 – 53) of the year from a date. |
WEEKOFYEAR(date)
Say today was Jul 4th, 2011, WEEKOFYEAR(NOW()) would be 28 |
YEAR |
Get the year of the date. |
YEAR(date)
Say today was Oct 31st, 2004, YEAR(NOW()) would be 2004 |
General
Function | Description | Example |
---|---|---|
BOOLEAN |
Converts the value to a Boolean. NOTE: “true” and “false” may be used in place of BOOLEAN(“true”) and BOOLEAN(“false”). |
BOOLEAN(value)
BOOLEAN(“true”) would be true as a Boolean Say the school was a public school, BOOLEAN(School.privateSchool) would be false as a Boolean BOOLEAN(“yes”) would be false as a Boolean since “yes” is not a valid value BOOLEAN(42) would be false as a Boolean since 42 is not a valid value |
ENCODEASBASE64STRING |
Encodes an array of bytes as a Base64 encoded text. |
ENCODEASBASE64STRING(array-of-bytes, optional-type-prefix)
ENCODEASBASE64STRING(Photo.Data, “png”) would be the content of Photo.Data encoded to Base 64 text ENCODEASBASE64STRING(Photo.Data, “data:image/jpeg;base64,”) would be the content of Photo.Data encoded to Base 64 text |
EXPRESSION |
Converts the value to an expression and evaluates it. |
EXPRESSION(value)
EXPRESSION(“ADD(1, 2)”) would be 3 Say GREETING contained ‘CONCATENATE(“Hello “, NAME)’ and NAME contained ‘Pierce County’, EXPRESSION(GREETING) would be Hello Pierce County |
JSONARRAY |
Creates a JSON array with the given values. |
JSONARRAY(value, optional-value)
JSONARRAY(3,”too”,1) would be an array that contained the number 3 in the first position, “too” in the second position, and 1 in the third position |
JSONARRAYGET |
Gives back the item in a JSON array with a 0 based index. |
JSONARRAYGET(json-array, index)
JSONARRAYGET(JSONARRAY(3,”too”,1), 2) would be too |
JSONARRAYLENGTH |
Gives the number of items in a JSON array. |
JSONARRAYLENGTH(json-array)
JSONARRAYLENGTH(JSONARRAY(3,”too”,1) would be 3 |
JSONOBJECT |
Creates a JSON object with the given keys and values. NOTE: The values must be in pairs. First value is the key to the value and the second value is the value itself. |
JSONOBJECT(key, value, optional-key, optional-value)
Say FIRST contained ‘Emily’, JSONOBJECT(“first-name”, FIRST, “age”, 42) would be key first-name that has a value of Emily key age that has a value of 42 |
JSONOBJECTGET |
Gives back the value in a JSON object with a given key. |
JSONOBJECTGET(json-array, key)
JSONOBJECTGET(JSONOBJECT(“first-name”, FIRST, “age”, 42), “age”) would be 42 |
JSONPATH |
Gives back the value in a JSON formatted text with a given path. |
JSONPATH(json-formatted-text, $.path)
JSONPATH(“age: 42”, “$.age”) would be 42 |
STRING |
Converts the value to text. |
STRING(value)
STRING(5493.07) would be 5493.07 as text instead of a decimal number Say the school is a private school, STRING(School.privateSchool) would be true as text instead of a Boolean STRING(DATECREATE(28,2,2017)) would be Tue Feb 28 00:00:00 PST 2017 as text instead of a Date |
UUID |
Creates a globally unique 36 character identifier. |
UUID()
UUID()’s identifiers look like:
|
HTML
Function | Description | Example |
---|---|---|
HTML |
Creates a simple HTML tag. |
HTML(tag, text)
Say Person.Last Name was Smith, HTML(“h2”, Person.Last Name) would be <h2>Smith</h2> HTML(“p”, HTMLIMAGE(“http://www.piercecountywa.org/images/layout/design21/ClicktoHomeHP.jpg”)) would be <p><img src=’http://www.piercecountywa.org/images/layout/design21/ClicktoHomeHP.jpg’ ></p> |
HTMLIMAGE |
Creates an HTML image tag. |
HTMLIMAGE(url, alternate-text)
HTMLIMAGE(“http://www.piercecountywa.org/images/layout/design21/ClicktoHomeHP.jpg”) would be <img src=’http://www.piercecountywa.org/images/layout/design21/ClicktoHomeHP.jpg’ alt=’Pierce County Logo – a white mountain on a blue background’> |
HTMLLINK |
Creates an HTML link tag. |
HTMLLINK(text, url, optional-open-location)
HTMLLINK(“Pierce County”, “http://www.piercecountywa.org/”, “_self”) would be <a href=’http://www.piercecountywa.org/’ target=’_self’>Pierce County</a> |
Logical
Function | Description | Example |
---|---|---|
AND |
Gives true when all of the values are true. |
AND(value1, value2, optional-value)
Say a person’s phone number is published on the Pierce County intranet and they do want to recieve snow alerts, AND(PhoneType.personPhones.intranetInd, PhoneType.personPhones.pcwarnInd) would be true Say a person’s phone number is not published on the Pierce County intranet and they do want to recieve snow alerts, AND(PhoneType.personPhones.intranetInd, PhoneType.personPhones.pcwarnInd) would be false Say a person’s phone number is not published on the Pierce County intranet and they do not want to recieve snow alerts, AND(PhoneType.personPhones.intranetInd, PhoneType.personPhones.pcwarnInd) would be false |
BETWEEN |
Gives true when the first value is inclusively between the second and third values. |
BETWEEN(between, first, last)
BETWEEN(5, 1, 10) would be true BETWEEN(-3, -1, 5) would be false Say the person was hired on Apr 4th, 2004, BETWEEN(Person.regularHireDt, DATECREATE(4,4,2004), DATECREATE4,4,2014) would be true |
EQUALS |
Gives true when the two values are equal. Text comparison is case sensitive. |
EQUALS(value1, value2)
EQUALS(2, 2) would be true EQUALS(“squirrel”, “SQUIRREL”) would be false EQUALS(DATECREATE(22, 1, 1975), NOW()) would be false |
EQUALSIGNORECASE |
Gives true when the two strings are equals regardless of case. |
EQUALSIGNORECASE(value1, value2)
EQUALSIGNORECASE(2, 2) would be true EQUALSIGNORECASE(“squirrel”, “SQUIRREL”) would be true EQUALSIGNORECASE(DATECREATE(22, 1, 1975), NOW()) would be false |
GREATERTHAN |
Gives true when the first value is greater than the second value. |
GREATERTHAN(value1, value2)
GREATERTHAN(10, 2) would be true GREATERTHAN(2, 2) would be false GREATERTHAN(“dog”, “dog”) would be false GREATERTHAN(“Dog”, “dog”) would be false [because of the capital letter] |
GREATERTHANOREQUAL |
Gives true when the first value is greater than or equal to the second value. |
GREATERTHANOREQUAL(value1, value2)
GREATERTHANOREQUAL(10, 2) would be true GREATERTHANOREQUAL(2, 2) would be true GREATERTHANOREQUAL(“dog”, “dog”) would be true GREATERTHANOREQUAL(“Dog”, “dog”) would be false [because of the capital letter] |
IF |
Gives the second or third value depending on whether the first value is true. |
IF(examined-value, true-value, false-value)
Say a question on a form does not have an answer, IF(ISNULL(Form Answer.Answer), 0, 10) would be 0 Say a question on a form does have an answer, IF(ISNULL(Form Answer.Answer), 0, 10) would be 10 Say today was Jan 18, 2017 and the address was updated Sep 18, 2016, IF(GREATERTHAN(Address.lastUpdated, DATEADD(-1, “year”, NOW())), “Address was updated in the last year”, “Address was not updated in the last year”) would be Address was updated in the last year |
IN |
Gives true when the first value is found in any of the other provided values. |
IN(find-value, value, optional-value)
IN(42, 57) would be false IN(42, 57, 42, 13, 999, 13, 0) would be true Say the person’s last name was Black, IN(Person.Last Name, “Smith”, “Blackstone”, “Jones”) would be false Say the person’s last name was Black, IN(Person.Last Name, “Smith”, “Black”, “Jones”) would be true |
ISNULL |
Gives true when the value is null. (Null is not a value.) |
ISNULL(variable-or-function)
Say a decedent’s social security number is not set, ISNULL(Decedent.SSN) is true |
LESSTHAN |
Gives true when the first value is less than the second value. |
LESSTHAN(value1, value2)
LESSTHAN(10, 2) would be false LESSTHAN(2, 2) would be false LESSTHAN(“dog”, “dog”) would be false LESSTHAN(“Dog”, “dog”) would be true [because of the capital letter] |
LESSTHANOREQUAL |
Gives true when the first value is less than or equal to the second value. |
LESSTHANOREQUAL(value1, value2)
LESSTHANOREQUAL(10, 2) would be false LESSTHANOREQUAL(2, 2) would be true LESSTHANOREQUAL(“dog”, “dog”) would be true LESSTHANOREQUAL(“Dog”, “dog”) would be true [because of the capital letter] |
NOT |
Turn true to false and false to true. |
NOT(value)
Say an adoption docket number is not set, NOT(ISNULL(Adoption.docketNum)) would be false Say an adoption docket number is set, NOT(ISNULL(Adoption.docketNum)) would be true |
OR |
Gives true when any of the values are true. |
OR(value1, value2, optional-value)
Say a person’s phone number is published on the Pierce County intranet and they do want to recieve snow alerts, OR(PhoneType.personPhones.intranetInd, PhoneType.personPhones.pcwarnInd) would be true Say a person’s phone number is not published on the Pierce County intranet and they do want to recieve snow alerts, OR(PhoneType.personPhones.intranetInd, PhoneType.personPhones.pcwarnInd) would be true Say a person’s phone number is not published on the Pierce County intranet and they do not want to recieve snow alerts, OR(PhoneType.personPhones.intranetInd, PhoneType.personPhones.pcwarnInd) would be false |
Number
Function | Description | Example |
---|---|---|
ABS |
Calculate the absolute value of a number. |
ABS(value)
ABS(-12) would be 12 ABS(9.5) would be 9.5 |
ACOS |
Calculate the arccosine of a number. |
ACOS(value)
ACOS(-1) would be 3.141592653589793 |
ADD |
Calculates the sum of the numbers. |
ADD(value1, value2, optional-value)
ADD(1, 2) would be 3 ADD(3, 4.5, 6, 7, 8.9) would be 30.3 |
ASIN |
Calculate the arcsine of a number. |
ASIN(value)
ASIN(-1) would be -1.5707963267948966 |
ATAN |
Calculate arctangent of a number. |
ATAN(value)
ATAN(1) would be 0.7853981633974483 |
CEIL |
Calculate the ceiling of a number. |
CEIL(value)
CEIL(12.67) would be 13.0 CEIL(-1.1) would be -1.0 CEIL(4.3) would be 5.0 CEIL(4) would be 4.0 |
COS |
Calculate cosine of a number. |
COS(value)
COS(1) would be 0.5403023058681398 |
COT |
Calculate cotangent of a number. |
COT(value)
COT(1) would be 0.642092615934331 |
DEGREES |
Convert radians to degrees. |
DEGREES(value)
DEGREES(1) would be 57.29577951308232 |
DIVIDE |
Divide each number by the next number. |
DIVIDE(dividend, divisor, optional-divisor)
DIVIDE(10, 2) would be 5.0 DIVIDE(6.4, 8) would be 0.8 DIVIDE(1.2, 2.3, 3.4, 4.5) would be 0.03410059676044331 |
DOUBLE |
Convert the value to a double. |
DOUBLE(value)
DOUBLE(“1.23”) would be 1.23 DOUBLE(“3”) would be 3.0 DOUBLE(3) would be 3.0 |
EXP |
Calculate the value of e to the x. |
EXP(power)
EXP(0) would be 1.0 EXP(1) would be approximately 2.718281828459045 EXP(-1) would be approximately 0.36787944117144233 EXP(2) would be approximately 7.38905609893065 |
FLOOR |
Calculate the floor of a number. |
FLOOR(value)
FLOOR(12.67) would be 12.0 FLOOR(-1.1) would be -2.0 FLOOR(4.3) would be 4.0 FLOOR(4) would be 4.0 |
LOG |
Calculate natural (e) logarithm of a number. |
LOG(result)
LOG(0) would be infinity LOG(2.718281828459045) would be 1.0 LOG(0.367879441171442) would be approximately -1.0 LOG(7.389056098930649) would be approximately 2.0 LOG(10) would be approximately 2.302585092994046 |
MAX |
Gives the largest number. |
MAX(value1, value2, optional-value)
MAX(10, 5) would be 10 MAX(5.2, 10) would be 10 MAX(1.1, 3.3, 2.2, 0) would be 3.3 |
MIN |
Gives the smallest number. |
MIN(value1, value2, optional-value)
MIN(10.2, 5) would be 5 MIN(5, 10) would be 5 MIN(1.1, 3.3, 2.2, 0) would be 0.0 |
MOD |
Calculate the remainder after one number is divided by the other number. |
MOD(dividend, divisor)
MOD(14, 5) would be 4 |
MULTIPLY |
Multiply each number with the next number. |
MULTIPLY(value1, value2, optional-value)
MULTIPLY(10, 2) would be 20.0 MULTIPLY(6.4, 8) would be 51.2 MULTIPLY(1.2, 2.3, 3.4, 4.5) would be 42.227999999999994 |
NUMBERFORMAT |
Format a number as a string. If format does not accommodate the provided precision, value will be rounded up. |
NUMBERFORMAT(number, format)
NUMBERFORMAT(4.241234, “.”) would be 4.24 NUMBERFORMAT(4.241234, “00.##”) would be 04.24 NUMBERFORMAT(4.241234, “00.00”) would be 04.24 |
PI |
Gives the number for π. |
PI() Takes no values, variables, or functions PI() would be approximately 3.141592653589793 |
POW |
Calculate the base to the exponent power. |
POW(base, power)
POW(7, 2) would be 49 POW(7, -2) would be 0.02040816326530612 POW(-7, 2) would be 49 POW(-7, -2) would be 0.02040816326530612 |
RADIANS |
Convert degrees to radians. |
RADIANS(value)
RADIANS(45) would be 0.7853981633974483 |
RANDOM |
Pick a random number inclusively between two numbers. |
RANDOM(first, last)
RANDOM(0, 10) would be a whole number between 0 and 10 inclusive |
ROUND |
Round the number. If there is a tie (5), value will be rounded up. |
ROUND(value)
ROUND(12.67) would be 13 ROUND(-1.1) would be -1 ROUND(4.3) would be 4 ROUND(4) would be 4 |
ROUNDTODECIMAL |
Round the number to a specific number of decimal places. Optionally choose to round up or round down – if not specified and there is a tie (5), value will be rounded up. |
ROUNDTODECIMAL(value, number-decimal-places, optional-rounding-direction)
ROUNDTODECIMAL(12.675, 2) would be 12.68 ROUNDTODECIMAL(12.675, 2, true) would be 12.68 ROUNDTODECIMAL(12.675, 2, false) would be 12.67 ROUNDTODECIMAL(-1.15, 1) would be -1.2 ROUNDTODECIMAL(4.398215, 1) would be 4.4 ROUNDTODECIMAL(4.398215, 3) would be 4.398 |
SIN |
Calculate sine of a number. |
SIN(value)
SIN(1) would be 0.8414709848078965 |
SQRT |
Calculate the square root of a number. |
SQRT(value)
SQRT(9) would be 3.0 SQRT(163.84) would be 12.8 |
SUBTRACT |
Subtract one number from next number. |
SUBTRACT(value1, value2, optional-value)
SUBTRACT(10, 3) would be 7.0 SUBTRACT(3, 10) would be -7.0 SUBTRACT(3, 10.5, 9) would be -16.5 SUBTRACT(10.5, 9, 3) would be -1.5 |
TAN |
Calculate tangent of a number. |
TAN(value)
TAN(1) would be 1.5574077246549023 |
TRUNC |
Gives the whole part of a number. |
TRUNC(value)
TRUNC(9.78) would be 9 TRUNC(9) would be 9 TRUNC(-9.78) would be -9 TRUNC(0.0004) would be 0 TRUNC(-0.0004) would be -0 |
Text
Function | Description | Example |
---|---|---|
CONCATENATE |
Combines multiple text values. |
CONCATENATE(value1, value2, optional-other-values)
Say NAME contained ‘Pierce County’, CONCATENATE(“Hello “, NAME) would be Hello Pierce County |
DECODEBASE64STRING |
Decode a base 64 encoded text to an array of bytes. |
DECODEBASE64STRING(value)
Say Base64Text containted a base 64 text value, DECODEBASE64STRING(Base64Text) would be a byte array of that text |
ENDSWITH |
Gives true when the value ends with the other value. |
ENDSWITH(whole, part)
Say the person’s first name was Betty, ENDSWITH(person.First Name, “ett”) would be false |
INDEXOF |
Find the index (starting with 0) of the first instance of the second value in the first value. |
INDEXOF(whole, part)
INDEXOF(“hello world”, “w”) would be 6 INDEXOF(“hello world”, “world”) would be 6 INDEXOF(“hello world of worlds”, “world”) would be 6 INDEXOF(“hello world”, “worlds”) would be -1 INDEXOF(“hello world”,”h”) would be 0 INDEXOF(“hello world”,”H”) would be -1 [because of the capital letter] |
INTEGER |
Convert the value to an integer. |
INTEGER(value)
INTEGER(“6”) would be 6 INTEGER(6.4) would be 6 |
LASTINDEXOF |
Find the index (starting with 0) of the last occurrence of the second string in the first string. |
LASTINDEXOF(whole, part)
LASTINDEXOF(“hello world”, “l”) would be 9 LASTINDEXOF(“hello world”, “lo”) would be 3 LASTINDEXOF(“hello world of worlds”, “world”) would be 15 LASTINDEXOF(“hello world”, “worlds”) would be -1 LASTINDEXOF(“hello world”, “h”) would be 0 LASTINDEXOF(“hello world”,”H”) would be -1 [because of the capital letter] |
LENGTH |
Gives the count of letters, numbers, and symbols contained in the text. |
LENGTH(value)
LENGTH(“hello”) would 5 LENGTH(“4.321”) would be 5 |
LOWERCASE |
Convert text to all small letters. |
LOWERCASE(value)
LOWERCASE(“Hello”) would be hello LOWERCASE(“HELLO”) would be hello LOWERCASE(“9:30 PM”) would be 9:30 pm |
REPLACE |
In the first value, replace all occurrences of what’s in the second value with what’s in the third value. |
REPLACE(whole, part-to-replace, replace-with)
REPLACE(“hello world”, “hello”, “hi”) would be hi world REPLACE(“1234.12”, “12”, “99”) would be 9934.99 |
STARTSWITH |
Gives true when the first value starts with the second value. |
STARTSWITH(whole, part)
STARTSWITH(“Hello there”, “Hello”) would be true STARTSWITH(“Hello there”, “hello”) would be false [because of the small letter] STARTSWITH(“123456”, “1234”) would be true STARTSWITH(“1234xyz”, “1234”) would be true |
SUBSTRING |
Gives the letters, numbers, and symbols found between and including the start and finish numbers. Beginning of value would be the number 0. |
SUBSTRING(whole, start-location, optional-end-location)
SUBSTRING(“ABCDEFG”, 2, 5) would be CDE SUBSTRING(“ABCDEFG”, 0, 5) would be ABCDE SUBSTRING(“ABCDEFG”, 4) would be EFG |
TEMPLATE |
Use a pattern to build text. |
TEMPLATE(pattern, %value1, optional-%values)
TEMPLATE(“My %s %s!”, “Pierce”, “County”) would be My Pierce County! Say a person’s name was John Q. Public, TEMPLATE(“%s %s %s”, Person.Last Name, Person.Middle Name, Person.First Name) would be Public Q. John TEMPLATE(“PC!”,”Pierce”,”County”) would be PC! as no %s was provided Say today was Oct 24th, 1991, TEMPLATE(“Today is: %s”, DATEFORMAT(NOW(), “YY MMMM 13”)) would be Today is: 24 October 91 TEMPLATE(“%d days to go!”, 99) would be 99 days to go! TEMPLATE(“%d %s”, 99, ” days to go!”) would be 99 days to go! TEMPLATE(“%f”, 13) would be 13.000000 TEMPLATE(“%.2f”, 13) would be 13.00 |
TRIM |
Remove spaces found at the very beginning and very end of text. |
TRIM(value)
TRIM(” hello sunshine! “) would be hello sunshine! TRIM(” hello sunshine! “) would be hello sunshine! |
UPPERCASE |
Convert text to all capital letters. |
UPPERCASE(value)
UPPERCASE(“Hello”) would be HELLO UPPERCASE(“heLLO”) would be HELLO UPPERCASE(“9:30 pm”) would be 9:30 PM |
Constraints
Security
Reporting
Queries
Introducing Dynamic Queries
Reports
How to Create a Simple Jasper Report
Prerequisites: 1) Create a query that does not contain subqueries and 2) download and install Jaspersoft® Studio.
Run your query and export the result as an “XML (Report)”. Save the downloaded XML file to MyReports in your Jaspersoft work space. The default location is C:\Users\$USERNAME\JaspersoftWorkspace\MyReports. (Replace $USERNAME with your login name.)
In Jaspersoft Studio, create a data adapter as follows:
-
Select File / New / Data Adapter.
-
Select “XML document” as the type of data adapter.
-
Enter the query name as the name of the data adapter.
-
Select the XML file from the C:\Users\$USERNAME\JaspersoftWorkspace\My Reports. (Replace $USERNAME with your login name.)
-
Choose “Use the report Xpath expression when filling the report”
-
Press the Finish button.
-
Set the XPath to /root/queries/query/results/DataObject.
Set the REPORT_PATH defaultValueExpression to C:/Users/$USERNAME/JaspersoftWorkspace/MyReports. (Replace $USERNAME with your login name.)
To be continued…
Workflow
Task Definitions
Task Events
Forms
Tags
Definition
Tags are a means to associate components, such as queries and reports, to multiple categories.
Guidelines
Industry Recommendations
-
Establish a tagging system
-
Make tags consistent
-
Singular vs. plural
-
Nouns vs. verbs
-
Capitalization
-
Usage of spaces
-
Usage of special characters
-
-
Keep tag names short
-
Err on the side of using too many tags rather than too few tags
-
Don’t replicate terms
-
Limit usage of abbreviations
-
Use words that identify what is recognizable about the item you are tagging
-
Revisit tag selection from time to time
Pierce County Requirements
-
Make tags consistent
-
Use mixed case for better readability
-
Use spaces for better readability
-
Do not use anything other than letters, numbers, or spaces to avoid duplicates where the only difference might be a hyphen
-
-
Err on the side of using too many tags rather than too few tags
-
Say you needed to tag queries with the following values: Blue, Red, Yellow, Blue Red, Blue Yellow, Red Yellow, Blue Red Yellow
-
If short tag names were used, you would only have to create 3 tags
-
If long tag names were used, you would have to create 7 tags
-
Query Tag Values Needed | Short Names | Short Name Usage | Long Names | Long Name Usage |
---|---|---|---|---|
Blue |
Blue |
Blue |
Blue |
Blue |
Red |
Red |
Red |
Red |
Red |
Yellow |
Yellow |
Yellow |
Yellow |
Yellow |
Blue Red |
Blue + Red |
Blue Red |
Blue Red |
|
Blue Yellow |
Blue + Yellow |
Blue Yellow |
Blue Yellow |
|
Red Yellow |
Red + Yellow |
Red Yellow |
Red Yellow |
|
Blue Red Yellow |
Blue + Red + Yellow |
Blue Red Yellow |
Blue Red Yellow |