I'm trying to generate a column formula that will calculate 'Dose' using 'Concentration' and 'Purity' for each row, but only using the 'Weight' associated with the most recent 'Collection Date' grouped by 'Subject ID'.
For the example below, the Dose for Subject A (Test #2) should be:
Dose (A, Test #2) = (1.3 * 0.95)/(26)
I have tried using the MAX() and COLLECT() functions to pull the overall most recent Weight for a Subject ID, but am having difficulties with syntax and integrating it into the Dose formula. Bonus points if you can help generate a formula for Total Dose by summing the (Concentration * Purity) values for each row and dividing by most recent Weight by Subject ID. Appreciate the help!