Forum Discussion
CH4R73Y
7 years agoNew Member
Calculating between dates
Ok, so this will be a little long winded. I'm looking to calculate on a couple of different items for offboarding employees in my company, the parameters are below and I'll go through what I'm trying...
- 7 years ago
Ah, no worries, got it:
Days to Close (Offboarding) = IF(HD_TICKET[Employee Leave Date]<HD_TICKET[CREATED], (DATEDIFF(HD_TICKET[CREATED].[Date],HD_TICKET[TIME_CLOSED].[Date],DAY)), (DATEDIFF(HD_TICKET[Employee Leave Date].[Date],HD_TICKET[TIME_CLOSED].[Date],DAY)))andAccount Disabled Days = IF(RELATED(HD_TICKET[Employee Leave Date].[Date])<RELATED(HD_TICKET[CREATED].[Date]), DATEDIFF(RELATED(HD_TICKET[CREATED].[Date]),HD_TICKET_CHANGE[AD Disabled Date].[Date],DAY), DATEDIFF(RELATED(HD_TICKET[Employee Leave Date].[Date]),HD_TICKET_CHANGE[AD Disabled Date].[Date],DAY))
CH4R73Y
7 years agoNew Member
Ah, no worries, got it:
Days to Close (Offboarding) = IF(HD_TICKET[Employee Leave Date]<HD_TICKET[CREATED], (DATEDIFF(HD_TICKET[CREATED].[Date],HD_TICKET[TIME_CLOSED].[Date],DAY)), (DATEDIFF(HD_TICKET[Employee Leave Date].[Date],HD_TICKET[TIME_CLOSED].[Date],DAY)))
and
Account Disabled Days = IF(RELATED(HD_TICKET[Employee Leave Date].[Date])<RELATED(HD_TICKET[CREATED].[Date]), DATEDIFF(RELATED(HD_TICKET[CREATED].[Date]),HD_TICKET_CHANGE[AD Disabled Date].[Date],DAY), DATEDIFF(RELATED(HD_TICKET[Employee Leave Date].[Date]),HD_TICKET_CHANGE[AD Disabled Date].[Date],DAY))