First thing: Define "visit" ----Visit is EM count Second: how do we identify " "TIE" Group_ID" ---TIE is having same EM counts, or Max_date, or Cost or Time Third: "Max_date is the same" same as ? Max_date or Min_date-----Max_date is the same as Max_date Fourth: "AND Time is equal" equal to what, assumes you mean value to time but which ones may not be obvious ---Time is calculated by the Max_date substract Min_date My output is to find the winner group ID for each period. for example, in period 1 both group IDs had same EM counts of 1, then follow rule 1a and 1b the second one has most recent Max_date, so the Group ID= 66532 is the winner for period 1, and so on... Please let me know if it's still not clear. Thanks, V.
... View more