Forum Discussion
SamBrown17
4 years agoHelper I
How to calculate Date diff with data setup
Hi Team, I have the example data below, I have a database full of record types which are jobs in my system, I want to calculate the average time or date difference between a set sequence of t...
- 4 years ago
SamBrown17 Right, it's the same principle but yours will look something like this:
Column = VAR __record = [record_id] VAR __type = [event_type] VAR __current = [created_at] VAR __currentStatus = [To (Status)] VAR __previous = IF(__type = "Job status updated", SWITCH(__currentStatus, "Scheduled",MAXX(FILTER('Table',[record_id] = __record && [From (Status) = "Book" && [To (Status)] = BLANK(),[created_at]), "Site Attended",MAXX(FILTER('Table',[record_id] = __record && [From (Status) = "Book" && [To (Status)] = "Scheduled",[created_at]) ) ) RETURN __current - __previous
SamBrown17
3 years agoHelper I
Late to come back but I cannot find out why, but when I try and finished this it results in "The end of the input was reached" and it puts 3 closed brackets on the end every time I hit enter
SamBrown17
3 years agoHelper I