I’m looking to calculate for each row, the time within a date range that the user specifies via filters.
For example,
User specifies a date range of Oct 29 to Nov 4 (one week)
For each row, there is a start time and end time. Start and end times are timestamps and can be any time before, within, or after the date range
For each row, I’d like to calculate how much time (from the row’s start and end time), in seconds, minutes, or hours, is within the user-specified date range.
Is this possible? I’d greatly appreciate any pointers here.
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
t