Forum Discussion

CH4R73Y's avatar
CH4R73Y
New Member
7 years ago
Solved

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...
  • CH4R73Y's avatar
    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)))
     
    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))