Visier Multi-Subject Rules Language

Use the Visier Multi-Subject Rules Language to validate data or perform additional transformations on already-modified data.

Overview

Use the Visier Multi-Subject Rules Language to validate data or perform additional transformations on already-modified data. For more information, see Multi-Subject Rules.

Multi-subject rules use the following format.

Copy
call RULENAME (
    ARG1, 
    ARG2, 
    …
)
  • call: Instructs Visier to call the rule.
  • RULENAME: Specifies the rule to use. Each rule executes different logic against the arguments in the formula. For more information about the available rules, see Rules.
  • ARG1, ARG2: Specifies the objects, such as subjects or properties, to validate. For more information about possible arguments, see Arguments.

Multi-subject rules apply to multiple subjects, so each object must use its qualified name in the rule. For example, the properties Employee.EmployeeID or Applicant.First_Name and the leveled dimension Employee.Location.City.

Note: In multi-subject rules, a subject can be:

  • A subject analytic object, such as Employee or Applicant.
  • A parent child hierarchy, such as a parent-child dimension like Supervisory Hierarchy.
  • A multi-value data table, such as Budgeted Compensation.

For examples of multi-subject rules, see Multi-Subject Rules Examples.

Rules

You can use the following rules in your multi-subject rule formulas.

adjustProfile

Extends the target subject's profile to correspond to the source subject's profile. Matches source and target subjects by their subject IDs.

Target subject profiles do not extend if the profile of the source falls outside the profile of the target. Profiles are only moved within their valid ranges.

Caution: The source subject and target subject must have the same time granularity. For more information, see Time granularity.

Syntax

Copy
call adjustProfile(
    sourceSubject,
    targetSubject,
    keyMapping,
    useNonActiveAttribute,
    adjustToTermination
)
  • sourceSubject: The subject whose event stream is used to adjust the target subject's profile event stream. The source subject's profile is not modified by this rule.
  • targetSubject: The subject whose profiles are adjusted based on the source subject. The target subject's profile may be modified by this rule.
  • keyMapping (optional): Controls how the source subject key is translated to the target subject key. Optionally specify the property that represents the ID of the target subject or use keyDropAfter to transform the keys so that they match. The default is to use the same key to access both subject members, such as EmployeeID.

    Tip: If the keyMapping isn't usable and you need to map subjects using something else, see profileAdjustmentLinkAttribute.

  • useNonActiveAttribute (optional, Boolean, default: false): If true, the rule considers the subject's non-active attribute and doesn't extend the target subject's profile beyond periods where the source subject is active.
  • adjustToTermination (optional, Boolean, default: false): If true, the rule pulls back the target subject's profile changes to match the source subject's first termination within the valid range, if available. This modifies the target subject's profile change events; it does not modify termination.

adjustRecursiveReference

Adjusts a profile's start and end dates if the object references itself, such as a parent-child dimension. Extends the start and end dates of the parent forward and backward to align with the start and end dates of its children. This rule makes the parent profile valid at all times that the child is valid.

When adjustRecursiveReference pulls a profile start date forwards, it also pulls any profile change events forward that happen on the same date as the profile start event to make sure the adjusted profile has the correct profile values.

Tip: Use adjustRecursiveReference with rules that extend the start or end dates of some, but not all, members in the subject and should extend the member's parent profiles too. For example, use this rule after the adjustProfile rule to make sure any member profile adjustments made by adjustProfile apply to their parents as well.

Syntax

Copy
call adjustRecursiveReference(
    targetSubject,
    targetSubject.RecursiveReferenceProperty,
    maxDepth
)
  • targetSubject: The subject to adjust. Must have self-references, such as how Organization Hierarchy references itself in the ParentOrgID property.
  • targetSubject.RecursiveReferenceProperty: The self-reference property in targetSubject, such as ParentOrgID.
  • maxDepth (optional, integer, default: 20): The lowest level of the hierarchy to check parent-child relationships. If the hierarchy has more levels than maxDepth, the rule may not adjust all parents.

extendedStateReconciliationRule

Reconciles the target subject's state based on a reference subject's state with the option to specify a state after the reference subject's last termination state. For example, if a Requisition is closed, all Applicants should also be closed.

Tip: For non-extended state reconciliation, see stateReconciliationRule.

Syntax

Copy
call extendedStateReconciliationRule(
    referenceSubject,
    referenceProperty,
    targetSubject,
    keyProperty,
    targetProperty,
    stateMap,
    referenceStateAfterLastTermination,
    gracePeriod
)
  • referenceSubject: The subject to use to reconcile the target subject's state. The reference subject is not modified by this rule.
  • referenceProperty: The reference subject's property that determines the state against which to validate the target subject's state. The reference property is not modified by this rule.

    For example, if Applicant is the target subject, and Requisition is the reference subject, then Requisition.Requisition_Status is the reference property because its value is the state you want to reconcile against.

  • targetSubject: The subject whose state you want to reconcile. This subject's event stream may be modified by this rule.
  • keyProperty: The target subject's property that references the reference subject member's ID.

    For example, if Applicant is the target subject and Requisition is the reference subject, then Applicant.RequisitionID is the key property because it references Requisition's subject member ID.

  • targetProperty: The target subject's property that determines the state to validate against the reference property's state. The target property value may be modified by this rule.

    For example, if Applicant is the target subject, Requisition is the reference subject, and Requisition.Requisition_Status is the reference property, then Applicant.Applicant_Status is the target property because its value is the state you want to reconcile.

  • stateMap (optional): The reference property values against which to validate the target subject and the specifications for how to reconcile the target subject's states. Also specifies the values to change invalid target property values to. In stateMap, only map the values that require validation.

    The state map format is:

    Copy
    {
        "referenceProperty value" -> { { "targetProperty value valid for this referenceProperty value", "another valid targetProperty value" } -> "targetProperty value to use if existing value is not valid" }
    }
  • referenceStateAfterLastTermination (optional): The reference property value after the reference subject's last profile termination. This ensures the target subject's state changes if the reference subject was terminated, but their reference property doesn't reflect the termination. If not specified, the rule behaves the same as stateReconciliationRule.
  • gracePeriod (optional, default: 0): The period that the target subject's state can be invalid without being corrected by the rule with respect to the reference subject's state changes. During the grace period, the target subject's state is frozen and is unchanged by the rule. After the grace period, the target subject is reconciled to a valid state if the target subject is not valid. The grace period:
    • Is granular to 1 day.
    • Is inclusive.
    • Starts at each change of the reference subject's state, not the target subject's state.

hasChildMemberRule

Checks whether a subject member has any children. The subject's associated parent-child dimension specifies the parent-child relationship. For example, if you want to know whether an employee has any direct reports, you can use Employee.Manager_Status and the Organization_Hierarchy parent-child dimension in this rule.

Syntax

Copy
call hasChildMemberRule(
    populationSubject,
    orgIDProperty,
    statusProperty,
    activeChildren,
    parentChildSubject,
    orgHeadIDProperty
)
  • populationSubject: The subject to check for children.
  • orgIDProperty: The subject attribute that references the parent-child dimension.
  • statusProperty: The subject attribute that identifies whether the subject member has any children.
  • activeChildren: If true, the rule only considers active children. If false, the rule considers active and inactive children. Default is true.
  • parentChildSubject: The parent-child dimension that specifies the subject's parent-child relationships.
  • orgHeadIDProperty: The parent-child dimension's attribute that identifies the parent in a parent-child relationship.

hasRequiredChildMemberRule

Checks whether a parent subject member's children have certain attribute values. For example, you can use this rule to check whether a manager's direct reports have a Gender value of F.

Syntax

Copy
call hasRequiredChildMemberRule(
    populationSubject,
    orgIDProperty,
    statusProperty,
    attributeValueMap,
    parentChildSubject,
    orgHeadIDProperty
)
  • populationSubject: The subject in which to check the parent-child attributes.
  • orgIDProperty: The subject attribute that references the parent-child dimension.
  • statusProperty: The subject attribute that identifies whether the subject member has any children.
  • attributeValueMap: The subject's property value to check for the parent's children.

    The attribute value map format is:

    Copy

        populationSubjectProperty -> propertyValue 
    }
  • parentChildSubject: The parent-child dimension that specifies the subject's parent-child relationships.
  • orgHeadIDProperty: The parent-child dimension's attribute that identifies the parent in a parent-child relationship.

orgBackwardExtensionRule

Captures an as-is organization hierarchy by taking the organization hierarchy's structure as-was on the date boundary (or the end of time if you don't specify dateBoundary) and projects the hierarchy backward to the start of the application. The rule displays the current hierarchy as if it had existed forever in the generated form. For more information about as-is and as-was hierarchies, see Understanding the Behavior of Organization Hierarchies Across History.

Terminated organization members are revived from the terminated date backward. You can add a prefix or suffix to inactive organization members to identify them as inactive.

Syntax

Copy
call orgBackwardExtensionRule(
    parentChildSubject, 
    nameProperty, 
    prefix, 
    suffix, 
    dateBoundary
)
  • parentChildSubject: The parent-child dimension on which to execute the rule.
  • nameProperty: The property that identifies the parent-child dimension organization.
  • prefix (optional): A string to add before an inactive organization's name.
  • suffix (optional): A string to add after an inactive organization's name.
  • dateBoundary (optional, default: 9999, 12, 31): The date at which to capture the organization hierarchy and project it forward.

orgForwardExtensionRule

Captures an as-is organization hierarchy by taking the organization hierarchy's structure as-was on the date boundary (or the end of time if you don't specify dateBoundary) and projects the hierarchy forward to the end of the application. The rule displays the current hierarchy as if it will exist forever (or until the specified dateBoundary) in the generated form. This is useful if you want to filter by an old organization hierarchy.

If an organization member was terminated after the specified dateBoundary, the organization member is extended from the dateBoundary date forward. You can add a prefix or suffix to inactive organization members to identify them as inactive.

Syntax

Copy
call orgForwardExtensionRule(
    parentChildSubject, 
    nameProperty, 
    dateBoundary,
    prefix, 
    suffix
)
  • parentChildSubject: The parent-child dimension on which to execute the rule.
  • nameProperty: The property that identifies the parent-child dimension organization.
  • dateBoundary (optional, default: 9999, 12, 31): The date from which to capture the organization hierarchy and project it backward.
  • prefix (optional): A string to add before an inactive organization's name.
  • suffix (optional): A string to add after an inactive organization's name.

parentChildrenAttributeValueDifferenceRule

Checks whether a specific attribute for a parent is different from any of its children. For example, you can use this rule to check whether a manager's direct reports are at a different location than the manager.

Syntax

Copy
call parentChildrenAttributeValueDifferenceRule(
    populationSubject,
    orgIDProperty,
    infoProperty,
    statusProperty,
    parentChildSubject,
    orgHeadIDProperty,
    useNonActiveAttribute
)
  • populationSubject: The subject in which to find parent-child attribute differences.
  • orgIDProperty: The subject attribute that references the parent-child dimension.
  • statusProperty: The subject attribute to compare between the parent and children.
  • infoProperty: The subject attribute that the rule uses to show if there is a difference between attribute values. For example, you can use Employee.Manager_Status to identify whether a manager's direct reports are all at the same location as the manager, some are at a different location, or the employee is not a manager.
  • parentChildSubject: The parent-child dimension on which to execute the rule.
  • orgHeadIDProperty: The parent-child dimension's attribute that identifies the parent in a parent-child relationship.
  • useNonActiveAttribute (optional, Boolean, default: false): If true, the rule only considers active children. If false, the rule considers active and inactive children. Default is false.

pcHierarchyMultiReferencePruningRule

Removes a level member from the available data if there are no references to that member in the dimension for a given time period, such as having no employees in a particular organization. If a parent level member and its child both have no references, pruning removes both level members. Pruning reflects your data more accurately because it only shows level members that have members during the selected time period. Pruning can optionally exclude periods where employees were nonactive. This is useful to clean up messy hierarchies and reduce the number of filter options. For more information about pruning, see Turn on pruning.

Syntax

Copy
call pcHierarchyMultiReferencePruningRule(
    subjectToPrune, 
    parentProperty, 
    populationSubjectMap, 
    excludedIDs, 
    nonActivePropertyMap, 
    persistentFlagConfig
)
  • subjectToPrune: The subject in which to remove hierarchies that have no members.
  • parentProperty: The parent-child dimension's attribute that identifies the parent in a parent-child relationship.
  • populationSubjectMap: The properties that reference the hierarchy, such as Employee.Organization_ID and Applicant.Organization_ID. All properties in populationSubjectMap must have at least one member that references the hierarchy member. If any of the property members do no reference the hierarchy member, the hierarchy member is pruned from the hierarchy.

    The population subject map format is:


        subject -> property,
        subject -> property,
        ...
    }
  • excludedIDs (optional): The parent-child dimension members IDs to skip during validation. Default is to validate all IDs. Use excludedIDs to manually bypass the rule for hierarchy members that have no incoming references but you still want to display in Visier.
  • nonActiveProperty (optional): The property that indicates whether or not the member is active. If not specified, the rule checks all active and nonactive members.

    The nonactive property map format is:

    Copy

        subject -> property 
    }
  • persistentFlagConfig (optional): Indicates whether the hierarchy member can be pruned. Default is to allow pruning of any hierarchy member.

    The persistent flag format is:

    Copy
    intFlag(subjectToPruneProperty, flagOnValue)

profileAdjustmentLinkAttribute

Extends the target subject's profile to the period in which the source subject's attribute references the target subject's subject ID. Matches source and target subjects by the source subject's attribute and the target subject's subject ID.

Example: Let's say Employee's attribute Employee.Organization_ID references Organization Hierarchy's Organization_ID. In this example:

  • Employee is the source subject.
  • Organization_ID is the link attribute.
  • Organization Hierarchy is the target subject.

This rule behaves like adjustProfile, except:

  • The source subject and target subject match based on the source subject's attribute and the target's subject ID. The source subject ID is not used.
  • The target subject member's profile is adjusted to the time period of the source subject's attribute, not the source subject. For example, Organization Hierarchy's profile is adjusted to the period of Employee.Organization_ID.

Caution: The source subject and target subject must have the same time granularity. For more information, see Time granularity.

Syntax

Copy
call profileAdjustmentLinkAttribute(
    sourceSubject,
    targetSubject,
    linkAttribute,
    keyMapper,
    useNonActiveAttribute,
    adjustToTermination
)
  • sourceSubject: The subject whose event stream is used to adjust the target subject's profile event stream. The source subject's profile is not modified by this rule.
  • targetSubject: The subject whose profiles are adjusted based on the source subject. The target subject's profile may be modified by this rule.
  • linkAttribute: The source subject attribute that references the subject ID of the target subject.
  • keyMapper (optional): Controls how the source subject key is translated to the target subject key. Optionally specify the property that represents the ID of the target subject or use keyDropAfter to transform the keys so that they match. The default is to use the same key to access both subject members, such as EmployeeID.
  • useNonActiveAttribute (optional, Boolean, default: false): If true, the rule considers the subject's non-active attribute and doesn't extend the target subject's profile beyond periods where the source subject is active.
  • adjustToTermination (optional, Boolean, default: false): If true, the rule pulls back the target subject's profile changes to match the source subject's first termination within the valid range, if available. This modifies the target subject's profile change events; it does not modify termination.

referenceDVPRule

Checks the validity of references between subjects, including the referenced member's parent's validity. If a source subject references an attribute in the target subject, the referenced member and its parent must be valid for the time period that the source subject references it. If the attribute isn't valid, referenceDVPRule reassigns the attribute to its default value provider (DVP). This is useful if a manager record disappears and you want the missing manager's employees to report up to the next level.

Tip: To check the validity of a member but not its parent, see referenceRule.

Syntax

Copy
referenceDVPRule(
    sourceSubject, 
    referenceInSource, 
    targetSubject, 
    parentProvider, 
    [
        {excludedIDs}, 
        nonActiveProperty
    ]
)
  • sourceSubject : The subject that references another subject's property.
  • referenceInSource: The source subject property that is associated with the target subject.
  • targetSubject: The subject that the reference property is associated with.
  • parentProvider: The parent of the referenced property.
    • nextValidParent(): The next valid parent's ID.
  • excludedIDs (optional): The member IDs to exclude from the rule.
  • nonActiveProperty (optional): The target subject's property that indicates whether or not the member is active. If not specified, the rule checks all active and nonactive members.

referenceRule

Checks the validity of references between subjects. If a source subject references an attribute in the target subject, the referenced member must be valid for the time period that the source subject references it. If the attribute isn't valid, referenceRule reassigns the attribute to its default value. This is useful to remove a profile whenever it has an invalid reference.

Tip: To check the validity of a member and its parent, see referenceDVPRule.

Syntax

Copy
referenceRule(
    sourceSubject, 
    referenceInSource, 
    targetSubject, 
    {excludedIDs}, 
    defaultValue, 
    nonActiveProperty
)
  • sourceSubject : The subject that references another subject's property.
  • referenceInSource: The source subject property that is associated with the target subject.
  • targetSubject: The subject that the reference property is associated with.
  • excludedIDs (optional): The member IDs to exclude from the rule.
  • defaultValue (optional): The value to reassign to a reference property if it is not valid.
  • nonActiveProperty (optional): The target subject's property that indicates whether or not the member is active. If not specified, the rule checks all active and nonactive members.

resolvePropertyValidityPeriod

Handles properties with a specific validity period or expiration, such as performance rating. Adjusts properties so that they start and expire as intended and fills any gaps with a default non-applicable value.

If there are validity periods with overlapping ranges, this rule converts the ranges so that they don't overlap. For example, if you have two validity periods of January to June and February to December, they overlap from February to June. The rule converts the ranges to January to February and February to December.

Caution: Different calls to resolvePropertyValidityPeriod cannot use the same startDate, endDate, and nextUpdateDate properties; unique calls must use different date properties.

To resolve the validity of multiple properties, specify all properties in the property parameter; for example:

Copy
Resolves Employee.Performance, Employee.RatingName, and Employee.SomeIntAttribute.
call resolvePropertyValidityPeriod(
    Employee,
    {
        Employee.Performance, 
        Employee.RatingName, 
        Employee.SomeIntAttribute
    },
    Employee.PerformanceStartDate,
    Employee.PerformanceEndDate,
    Employee.PerformanceNextEvalDate,
    defaultCTResolutionStrategy(Employee.Performance)
)

Syntax

Copy
resolvePropertyValidityPeriod(
    subject, 
    property, 
    startDate, 
    endDate, 
    nextUpdate, 
    ctResolution
)
  • subject: The subject that contains the value to resolve.
  • property: One or more properties whose validity periods to resolve.
  • startDate: The earliest date from which the current property value is valid, excluding profiles that are inactive or haven't started at this date.
  • endDate: The latest date up to which the current property value is valid if another value follows, excluding profiles that were terminated or became inactive prior to this date. This end date is exclusive.

    Tip: If Performance Rating ends on 2018-01-31, its value resets to -1 on 2018-01-31 if there are future performance ratings because the end date is exclusive. To end Performance Rating on the correct date, update your Performance Rating extraction rule to the end date plus 1. In this example, the end date in the extraction rule must be 2018-02-01 to end Performance Rating on 2018-01-31.

  • nextUpdate: The next date on which an update to the property value is expected or the latest date up to which the current property value is valid if no other values follow.

  • ctResolution: A conception and termination resolution strategy. Must be one of:
    • defaultCTResolutionStrategy: Property values are valid from the start date to the end date or next update date. The value doesn't reset a day after termination because system events will handle it. The platform expects a new property value from your source files when a new profile begins.
    • extendToDayAfterTermination: Extends the last property value past the next update date up to termination.
    • keepValuePastTermination: Persists the last property value from before the last termination to when a new profile begins.
    • resetToValueOnConception: Resets the property value to a defined value on conception. The defined value is different from the default undefined value.
    • resetToValueOnConception(propertyToResetValueMap, -1): Resets multiple property values to a defined value on conception. The defined value is different from the default undefined value. The propertyToResetValueMap specifies the default value for any property in the resolvePropertyValidityPeriod.

      The property to reset value map format is:

      Copy

          property -> resetValue,
          property -> resetValue,
          ...
      }

stateReconciliationRule

Reconciles the target subject's state based on a reference subject's state. For example, if a Requisition is closed, all Applicants should also be closed.

Tip: If the reference subject is terminated but its state should still be reconciled, see extendedStateReconciliationRule instead.

Syntax

Copy
call stateReconciliationRule(
    keyProperty,
    referenceProperty,
    targetProperty,
    referenceSubject,
    targetSubject,
    stateMap,
    gracePeriod
)
  • keyProperty: The target subject's property that references the reference subject member's ID.

    For example, if Applicant is the target subject and Requisition is the reference subject, then Applicant.RequisitionID is the key property because it references Requisition's subject member ID.

  • referenceProperty: The reference subject's property that determines the state against which to validate the target subject's state. The reference property is not modified by this rule.

    For example, if Applicant is the target subject, and Requisition is the reference subject, then Requisition.Requisition_Status is the reference property because its value is the state you want to reconcile against.

  • targetProperty: The target subject's property that determines the state to validate against the reference property's state. The target property value may be modified by this rule.

    For example, if Applicant is the target subject, Requisition is the reference subject, and Requisition.Requisition_Status is the reference property, then Applicant.Applicant_Status is the target property because its value is the state you want to reconcile.

  • referenceSubject: The subject to use to reconcile the target subject's state. The reference subject is not modified by this rule.
  • targetSubject: The subject whose state you want to reconcile. This subject's event stream may be modified by this rule.
  • stateMap (optional): The reference property values against which to validate the target subject and the specifications for how to reconcile the target subject's states. Also specifies the values to change invalid target property values to. In stateMap, only map the values that require validation.

    The state map format is:

    Copy
    {
        "referenceProperty value" -> { { "targetProperty value valid for this referenceProperty value", "another valid targetProperty value" } -> "targetProperty value to use if existing value is not valid" }
    }
  • gracePeriod (optional, default: 0): The period that the target subject's state can be invalid without being corrected by the rule with respect to the reference subject's state changes. During the grace period, the target subject's state is frozen and is unchanged by the rule. After the grace period, the target subject is reconciled to a valid state if the target subject is not valid. The grace period:
    • Is granular to 1 day.
    • Is inclusive.
    • Starts at each change of the reference subject's state, not the target subject's state.

Arguments

You can use the following arguments in your multi-subject rule formulas.

date

The format is date(yyyy, MM, dd). Used in:

defaultCTResolutionStrategy

Property values are valid from the start date to the end date or next update date. The value doesn't reset a day after termination because system events will handle it. The platform expects a new property value from your source files when a new profile begins. Used in:

extendToDayAfterTermination

Extends the last property value past the next update date up to termination. Used in: 

intFlag

Indicates whether the hierarchy member can be pruned. Default is to allow pruning of any hierarchy member. Used in:

keepValuePastTermination

Persists the last property value from before the last termination to when a new profile begins. Used in:

keyDropAfter

  • Transforms the source subject key and target subject key so that they match. Used in: 

nextValidParent

The next valid parent's ID. Used in:

resetToValueOnConception

Resets the property value to a defined value on conception. The defined value is different from the default undefined value. Used in: