Entity functions are used to perform operations on entity-specific data to produce global results, such as counting the number of instances of an entity, obtaining the highest/most recent or lowest/least recent value of an entity-level variable, and adding up numerical values gathered from each instance of the entity.
Be sure to use the exact syntax for these functions including spacing and parentheses as specified below.
TIP: The localized syntax for these functions may be viewed:
Function | Declarations | Example rule | Inputs | Outputs |
---|---|---|---|---|
For |
Source entity: the child Target entity: the school Relationship type: Many-to-one Relationship text: the child's school
|
|
the child's school: St Mary's; the school has a scholarship program: false
the child's school: St Joseph's; the school is closed for a pupil free day: true
the child's school: St Clare's Public School; the school name: St Clare's Public School |
the child may apply for a scholarship = false
the child does not have to go to school = true
the child's school name = St Clare's Public School |
ForScope |
Source entity: the person Target entity: the car Relationship type: One-to-one Relationship text: the person's car |
|
the car: NSW001; the number of times the car has broken down: 4 | the person has a reliable car = false |
ForScope (Alias) |
Source entity: the person Target entity: the person Relationship type: One-to-one Relationship text: the person's spouse |
|
the person: Fran; the person’s income: 500 the person: Seb; the person’s income: 250 |
the person has the highest taxable income=true (Fran) the person has the highest taxable income=false (Seb) |
ForAll |
Source entity: global Target entity: the child Relationship type: One-to-many Relationship text: the children |
|
the child: Sally; the child is at home: true; the child's location: home the child: Molly; the child is at home: true; the child's location: home the child: Elizabeth; the child is at home: false; the child's location: playground |
the playground is empty = false |
ForAllScope |
Source entity: the person Target entity: the cat Relationship type: One-to-many Relationship text: the person's cats |
|
the cat: Tiger; the cat is happy: false the cat: Kit; the cat is happy: true the cat: Patch; the cat is happy: true |
the person is happy = false |
ForAllScope (Alias) |
Source entity: Global Target entity: the person Relationship type: One-to-many Relationship text: the person's children |
|
the person: Tobias; the person's date of birth: 2001-03-03 the person: Alexandra; the person's date of birth: 2002-06-06 the person: Victoria; the person's date of birth: 2001-03-03 |
the person is lucky = false |
Exists |
Source entity: global Target entity: the child Relationship type: One-to-many Relationship text: the children |
|
the child: Isabelle ; the child is happy: false the child: Xavier; the child is happy: true the child: Phoebe; the child is happy: false the child: Rachel; the child is happy: false |
the playground has good equipment = true |
ExistsScope |
Source entity: the plan Target entity: the product Relationship type: Many-to-many Relationship text: the plan's products |
|
the plan: Plan 1; the plan's network: Vodafone the plan: Plan 2; the plan's network: Telstra the product: Product 1; the product's network: Optus the product: Product 2; the product's network: Vodafone |
the plan has incompatible products = true |
ExistsScope (Alias) |
Source entity: Global Target entity: the child Relationship type: One-to-many Relationship text: the children |
|
the child: Kenneth; the child’s date of birth: 2007-10-15 the child: Benny; the child’s date of birth: 2007-10-15 the child: Jenny; the child’s date of birth: 2006-01-02 |
the child is a twin = true (Kenneth) the child is a twin = true (Benny) the child is a twin = false(Jenny) |
IsMemberOf |
Source entity: the person Target entity: the dog Relationship type: Inferred (many-to-many) Relationship text: the person's favorite dogs |
|
the dog: Sam; the dog's age: 15 the person: James; the person's age: 21 |
the dog (Sam) is a member of the person's (James) favorite dogs = false |
IsNotMemberOf |
Source entity: the person Target entity: the cat Relationship type: One-to-many Relationship text: the person's hated cats Reverse relationship text: the cat's owner |
|
the cat: Moggy; the cat is a member of the person's hated cats: true | the cat (Moggy) is happy = false |
InstanceCount |
Source entity: the claimant Target entity: the child Relationship type: One-to-many Relationship text: the children |
|
the child: Anthony the child: Peter the child: Rebecca the child: Fiona |
the number of the claimant's children = 4 |
InstanceCountIf |
Source entity: the claimant Target entity: the child Relationship type: One-to-many Relationship text: the children |
|
the child: Anthony; the child is a school student: false the child: Peter; the child is a school student: false the child: Rebecca; the child is a school student: true |
the number of school students for the claimant = 1 |
InstanceMaximum |
Source entity: the claimant Target entity: the child Relationship type: One-to-many Relationship text: the children |
|
the child: Max; the child's bank balance: $50 the child: Sophie; the child's bank balance: $175 the child: Katie; the child's bank balance: $120 |
the highest bank balance of the claimant's children = $175 |
InstanceMaximumIf |
Source entity: the company Target entity: the employee Relationship type: One-to-many Relationship text: the employees |
|
the employee: David; the employee's date of employment: 01/01/2006; the employee is a permanent employee: true the employee: Shaun; the employee's date of employment: 24/08/2006; the employee is a permanent employee: false the employee: Anita; the employee's date of employment: 15/05/2006; the employee is a permanent employee: true |
the most recent date of employment of a permanent employee by the company = 2006-05-15 |
InstanceMinimum |
Source entity: the claimant Target entity: the child Relationship type: One-to-many Relationship text: the children |
|
the child: Harry; the child's weight in kilograms: 15 the child: Sharon; the child's weight in kilograms: 30 the child: Fran; the child's weight in kilograms: 45 |
the lightest of the claimant's children = 15 |
InstanceMinimumIf |
Source entity: the claimant Target entity: the child Relationship type: One-to-many Relationship text: the children |
|
the child: Sam; the child's age: 3; the child is female: false the child: Alex; the child's age: 4; the child is female: true the child: Sharon; the child's age: 6; the child is female: false the child: Paris; the child's age: 8; the child is female: true |
the youngest of the claimant's female children = 4 |
InstanceSum |
Source entity: the claimant Target entity: the child Relationship type: One-to-many Relationship text: the children |
|
the child: Mary; the CCB amount for the child: $500 the child: Sam; the CCB amount for the child: $250 the child: Lizzie; the CCB amount for the child: $150 |
the total Child Care Benefit payable to the claimant = $900 |
InstanceSumIf |
Source entity: the claimant Target entity: the child Relationship type: One-to-many Relationship text: the children |
|
the child: Sally; the annual school fees for the child: $18000; the child attends a boarding school: true the child: James; the annual school fees for the child: $15000; the child attends a boarding school: true the child: Bob; the annual school fees for the child: $10000; the child attends a boarding school: false |
the total cost of boarding school fees for the claimant = $33000 |
InstanceValueIf | Source entity:Global Target entity: the child Relationship type: One-to-many Relationship text: the children |
|
the age of the oldest child = 8 the child: Sam; the child's age: 3 the child: Alex; the child's age: 4 the child: Sharon; the child's age: 6 the child: Paris; the child's age: 8 |
the name of the oldest child = Paris |
See also: