This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I would probably do it the same way as @MarqueeCrew, but another suggestion is to use a sort tool to order the results and then a sample tool and group by PatID, DocID, DocType and take the last value.
The Max function is to pcik the maximum value in a single row.
If you take the output of the summarise tool into a join tool you can join with the Doc ID and Page Number equal to the Doc ID and Max Page Number. Then you just need to take the Joined output. Hope that makes sense!