Example of Using Formulas to Collapse Life Events

The example in this topic shows collapsing life event rules that use formulas to collapse life events.

In the Plan Configuration work area, you create:

  • Formulas using the Manage Fast Formulas task

  • Collapsing rules using the Collapsing Rules tab of the Manage Life Events task

Using Formulas to Create Collapsing Rules

If a Marriage event and Address Change event occur within 10 days apart, you want to collapse the events to a new Location Change event. The rule must apply only to workers in California. For workers located in the rest of the United States, these events can occur within a space of 30 days.

To achieve this scenario:

  1. Create two formulas of the Collapsing Rule formula type using the Manage Fast Formulas task:

    • The first formula should contain the logic to collapse the Marriage and Address Change events to the Location Change event. The events should collapse only if the employee is located in California, as shown in the following formula text:

      
      DEFAULT_DATA_VALUE for BEN_PPL_LER_NAME_TN is 'Default'
      DEFAULT_DATA_VALUE for BEN_PPL_PTNL_LER_FOR_PER_ID_NN is 0
      DEFAULT_DATA_VALUE for BEN_PPL_LER_ID_NN is 0
      DEFAULT for PER_ASG_ADD_COUNTRY is 'U'
      DEFAULT for PER_ASG_ADD_REGION2 IS 'C'
      
      i=1
      WINNING_LER_ID = 0
      VOID_PTNL_ID1 = 0
      VOID_PTNL_ID2 = 0
      
      L_PER_PER_ADD_COUNTRY = PER_ASG_ADD_COUNTRY
      L_PER_PER_ADD_REGION2 = PER_ASG_ADD_REGION2
      
      if(L_PER_PER_ADD_COUNTRY = 'US' AND L_PER_PER_ADD_REGION2='CA') then (
      	WHILE BEN_PPL_LER_NAME_TN.exists(i) loop (
      		if(BEN_PPL_LER_NAME_TN[i] = 'Marriage') then (
      			VOID_PTNL_ID1 = BEN_PPL_PTNL_LER_FOR_PER_ID_NN[i]
      		)
      		if(BEN_PPL_LER_NAME_TN[i] = 'Address Change') then (
      			VOID_PTNL_ID2 = BEN_PPL_PTNL_LER_FOR_PER_ID_NN[i]
      		)
      		i=i+1
      	)
      	if(VOID_PTNL_ID1 != 0 AND VOID_PTNL_ID2 != 0) then (
      		WINNING_LER_ID = 316
              return WINNING_LER_ID,VOID_PTNL_ID1,VOID_PTNL_ID2
      	)
      )
      return VOID_PTNL_ID1,VOID_PTNL_ID2
      
      Note: In the formula text, 316 is the ID of the Location Change life event. Replace the ID with an appropriate one that applies for your implementation.
    • The second formula should contain the logic to collapse the events if the worker is located anywhere in the US:

      
      DEFAULT_DATA_VALUE for BEN_PPL_LER_NAME_TN is 'Default'
      DEFAULT_DATA_VALUE for BEN_PPL_PTNL_LER_FOR_PER_ID_NN is 0
      DEFAULT_DATA_VALUE for BEN_PPL_LER_ID_NN is 0
      DEFAULT for PER_ASG_ADD_COUNTRY is 'U'
      DEFAULT for PER_ASG_ADD_REGION2 IS 'C'
      i=1
      
      WINNING_LER_ID = 0
      VOID_PTNL_ID1 = 0
      VOID_PTNL_ID2 = 0
      
      L_PER_PER_ADD_COUNTRY = PER_ASG_ADD_COUNTRY
      L_PER_PER_ADD_REGION2 = PER_ASG_ADD_REGION2
      
      WHILE BEN_PPL_LER_NAME_TN.exists(i) loop (
      		if(BEN_PPL_LER_NAME_TN[i] = Marriage') then (
      			VOID_PTNL_ID1 = BEN_PPL_PTNL_LER_FOR_PER_ID_NN[i]
      		)
      		if(BEN_PPL_LER_NAME_TN[i] = 'Address Change') then (
      			VOID_PTNL_ID2 = BEN_PPL_PTNL_LER_FOR_PER_ID_NN[i]
      		)
      		i=i+1
      	)
      	
      if(VOID_PTNL_ID1 != 0 AND VOID_PTNL_ID2 != 0) then (
      		WINNING_LER_ID = 316
      			return WINNING_LER_ID,VOID_PTNL_ID1,VOID_PTNL_ID2
      )	
      return VOID_PTNL_ID1,VOID_PTNL_ID2
      
  2. Create two collapsing rules using the Create Collapsing Rule page:

    • Assign a lower sequence number to the first collapsing rule and associate with it the formula that collapses events for workers located in California. The following table shows the configuration:

      Field

      Value

      Sequence

      1

      Configuration approach

      Use formula for rule logic

      Proximity days

      10

      Collapsing Formula

      California Workers Collapsing Rule

      Life Event Occurred Date

      Effective date of the batch process run

    • Assign a higher sequence number to the second collapsing rule. Associate with this rule the formula that collapses events for workers located in the rest of the US. The following table shows the configuration:

      Field

      Value

      Sequence

      2

      Configuration approach

      Use formula for rule logic

      Proximity days

      30

      Collapsing Formula

      Rest of US Workers Collapsing Rule

      Life Event Occurred Date

      Effective date of the batch process run

    You assign a lower sequence number to the rule that processes the California workers because you want the process to evaluate that rule first. The California workers rule is more restrictive than the rule that processes workers who reside elsewhere in the US. It is good practice to assign a higher sequence number to more restrictive rules for faster process performance.