Oct 02, 2023 05:05 AM
Good day to all
I am looking for some help for my problem after spending all morning on it.
My table is an 'audit table' for blood tests. I have a colum that is a linked field to another table that allows me to select the blood test requested (Samples requested). With each Sample there is an associated turnaround time from the lab. I have set this up as a single select and it is either 24hrs, 48hrs, 72hrs or 5 Days. To view these TAT, I have a colum with 'expected TAT' and this is a lookup field. However, when I select several Samples, I can have several TAT. I only want to see the longest TAT ie if I had 24hrs, 24hrs, 48hrs - I would only see 48hrs.
I have tried several different formulas and scripting and not wining at all.
Any help is appreciated.
Oct 02, 2023 02:06 PM - edited Oct 02, 2023 03:12 PM
Hi Brian! One way you can solve this is by using a Rollup field with the MAX(values) aggregator to return the only the highest TAT of the linked samples. In order to do this, you'll first need to make the output of the samples field you are rolling up a number.
Single-select fields output strings, not numbers - your easiest method would be to change the field type for "Expected TAT" from a single-select field to a number field (maybe "Expected TAT in Hours"). If you want to limit options for users and retain the single-select, then you can also add a formula field in your Samples table to read the "Expected TAT" field and transform it into a number (more on that below) - use that formula field as the basis for your roll-up in your Audit table!
Some caveats here:
{Expected TAT single select field} + 0
Hope this helps!