-- DATEDIFF computes the delta between two dates, using different units of measure
-- YEAFRAC returns the delta as a fraction (in years)
EVALUATE
VAR StartDate = DATE ( 2011, 01, 01 )
VAR EndDate = DATE ( 2012, 12, 15 )
RETURN
{
( "DATEDIFF Year", DATEDIFF ( StartDate, EndDate, YEAR ) ),
( "DATEDIFF Quarter", DATEDIFF ( StartDate, EndDate, QUARTER ) ),
( "DATEDIFF Month", DATEDIFF ( StartDate, EndDate, MONTH ) ),
( "DATEDIFF Day", DATEDIFF ( StartDate, EndDate, DAY ) ),
( "Subtraction", INT ( EndDate - StartDate ) ),
( "YEARFRAC", YEARFRAC ( StartDate, EndDate ) )
}
MeetingTimeMinsHours =
VAR _all = SUMX( Committees_Meetings; Committees_Meetings[time_end] - Committees_Meetings[time_start] ) * 1
VAR _days = INT( _all )
VAR _time = _all - _days
RETURN FORMAT( _time; "hh:mm")