I'm in a pickle. I have a crazy database backend with a ton of linked tables. My issue is that I need the primary diagnosis code with the newest date. I can use a running total and get the max effdat for the diag code where the diag type is primary...now I need to get the code with that effdat. I thought if I could set a global variable and set it to a primary diagnosis code, then in another formula I can use the formula
If effdat = (running total max effdat) and diagtype = 'primary' then
set the global variable = currrent diagnosis code
I guess somewhere I'd need to reset the global variable at the beginning of each group change - any help would be appreciated!
Thanks!