BusinessObjects Board

IF statement multiple conditions

Hello Crystal amateur needing help creating an IF statement with four variables using conditions. If employee is active and has a seniority higher than 365 days then “Eligible” if less “Not Eligible” and if active and {numeric field} >= 1 then “active” else “Terminated”


AO1950 (BOB member since 2019-03-08)

It looks like you’re actually looking for two different results - one that indicates whether the person is active or terminated and another for Eligible or Not Eligible. Here’s how I might write these (assuming that seniority is based on date of hire):


{@isActive}
if {active employee} and {numeric field} >= 1 then 
  'Active' 
else 
  'Terminated'

{@Eligible}
if {@isActive} = 'Active' and CurrentDate - {Hire Date} > 356 then 
  'Eligible' 
else 
  'Not Eligible'

“CurrentDate” is Crystal’s way of getting the date that the report is being run.

-Dell


hilfy :us: (BOB member since 2007-04-16)

Thank you


AO1950 (BOB member since 2019-03-08)