Forum Discussion
Average difference between two dates based on two other columns
Flawn , what is expected output?
You can try a new column like
if([Appointment Category] = " Service Request" ,
datediff( [Date], Minx(filter(Table, [Date] > earlier([Date]) && [Appointment Category] = "Meeting" && [Client ID] = earlier([Client ID])),[Date]), day()),
blank())
- Flawn5 years ago
Helper III
Thank you amitchandak for your quick response!
The expected output should be the difference, in days, between a service request appointment and the next non-service request appointment that client attends. After which the average difference is simple enough to calculate.
In the example case I provided, the expected output would be a 5 day difference for the blue, yellow, and green pairing. And a 4 day difference for the red pairing. Which would then average out to 4.75 days.
I tried your column and I am unable to verify whether or not it would work as, unfortunately, it seemed to demand too much memory use, producing a "There's not enough memory to complete this operation" error when i tried to introduce this column. This is the first time i've come across this error with this particular database. I've taken steps to reduce the memory burden Including unloading as many queries as possible, removing extraneous columns (there weren't many I could afford to remove), removing background loading of tables and upping the max allowed data cache - but the problem persists. . Can we produce a solution that is less demanding on the memory - or is there perhaps some way to fix this problem I am unfamiliar with?