Calculating Time within Date Range

You can create 2 parameters.
Date Fr, Date To to allow user to input parameter values

Then create a calculated field using the ifelse logic. Below I created an example, you need to extend a bit more to include all the ifelse logic to get the date range. it compares user input parameter(DateFr, DateTo) with dataset fields (Start Time, End Time)
ifelse(
{Start Time} < ${DateFr} AND {End Time} < ${DateTo},
ifelse({Start Time} > ${DateFr} AND {End Time} < ${DateTo},
‘0’,
toString(dateDiff(${DateFr}, {End Time}, “DD”))
),
toString(dateDiff({Start Time}, {End Time}, “DD”))
)

You will see a visual like below showing he date difference
image
t

1 Like