Between dates marker

I need to mark timestamps ‘Time 1’ between two other timestamps ‘Time 2’. Everything that is between, and including status ‘Begin’ and ‘End’ must have a marker. In my case it’s 1.
There are periods between ‘End’ and ‘Begin’ so those shouldn’t have any markers or eventually it could be 0 or NULL.
The periods between ‘Begin’ and ‘End’ can span across different months.


Many thanks,

Hello @ArtSal, in your dataset that you are using to build this, do you have that Status column value being returned? If so you could create the Time 2 value with an ifelse statement like this:
ifelse({Status} = "End" OR {Status} = "Start", {Time}, NULL)
That way anywhere that a Time value is associated with a Start or End marker it will populate the Time 2 field.

As for the markers, this might be a much easier addition to add it through your SQL that creates the dataset. Trying to manipulate a row value based on a different row value is tricky and often doesn’t work as expected in a calculated field. Can you add functionality in your SQL to show 1 or NULL in a marker column in your dataset creation?

Hi @DylanM unfortunately the values are not present. I guess I will have to modify the dataset using SQL.