Hi All,
I m using the below transform to calculate the Life Cycle state. The issue here i am facing is for leaving case i m not getting proper output. If the Contract_END_DATE is null also it shows as leaving. If the Contract_END_DATE is wihtin in next 14 days i need to mark the state as Leaving.
Any help s much appreciated !
{
"id": "333a4ed5-1d52-49fb-abd9-aff607d28193",
"name": "BLV_Workday_LCS",
"type": "static",
"attributes": {
"requiresPeriodicRefresh": "true",
"activestate": {
"attributes": {
"firstDate": "now",
"secondDate": {
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "HIREDATE",
"sourceName": "Workday"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"operator": "GTE",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"futureContractor": {
"attributes": {
"firstDate": {
"attributes": {
"expression": "now+14d/d",
"roundUp": false
},
"type": "dateMath"
},
"secondDate": {
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "HIREDATE",
"sourceName": "Workday"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"operator": "GTE",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"farFutureContractor": {
"attributes": {
"firstDate": {
"attributes": {
"expression": "now+15d/d",
"roundUp": false
},
"type": "dateMath"
},
"secondDate": {
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "HIREDATE",
"sourceName": "Workday"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"operator": "GT",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"inactivestate": {
"attributes": {
"firstDate": "now",
"secondDate": {
"type": "firstValid",
"attributes": {
"values": [
{
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "CONTRACT_END_DATE",
"sourceName": "Workday"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"now"
],
"ignoreErrors": "true"
}
},
"operator": "GT",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"leaving": {
"attributes": {
"firstDate": {
"attributes": {
"expression": "now+14d/d",
"roundUp": false
},
"type": "dateMath"
},
"secondDate": {
"type": "firstValid",
"attributes": {
"values": [
{
"attributes": {
"input": {
"type": "accountAttribute",
"attributes": {
"attributeName": "CONTRACT_END_DATE",
"sourceName": "Workday"
}
},
"inputFormat": "MM/dd/yyyy",
"outputFormat": "ISO8601"
},
"type": "dateFormat"
},
"now"
]
}
},
"operator": "GTE",
"positiveCondition": "yes",
"negativeCondition": "no"
},
"type": "dateCompare"
},
"value": "#if(($activestate=='yes') && ($inactivestate=='no'))active#elseif($inactivestate=='yes')inactive#elseif(($futureContractor=='yes')&&($activestate=='no'))futureContractor#elseif(($futureContractor=='no')&&($activestate=='no'))farFutureContractor#elseif($leaving=='yes')leaving#{else}UNKNOWN#end"
},
"internal": false
}