Hi novinosrin, Sorry for the late reply, because we're in different time zones. The format of my original data is like dataset two, but I think that data transposition can be done to facilitate data processing and understanding. The converted format is as follows: data two;
input PRIORITY EVENT $ EVENT_CATEGORY $ ;
datalines;
1 A A1
1 B A1
2 B A1
2 D B1
3 C B1
3 A A1
4 D B1
4 E B1
5 E B1
5 G A1
; Explanation: For ID 01, ID's category is A1 (show in dataset one), and the recommended item1 is 'G', because 'G' is the first event in category 'A1' (show in dataset two). A. What look up key from dataset one fetches 'G' which is in EVENT2 of dataset two? I am assuming it is ID_category of one<--> Event2_category? For recommended event1 -> ID_category of dataset one = Event_category of dataset two -> and ID_event of one ^= Event of two -> The order of priority is from top to bottom of dataset two Then, the recommended item2 is 'D', because of the priority and the order. (Priority1 is 'A' and 'B' item in dataset two, but ID 01 has already held two events in dataset one. Priority2 is 'B' and 'D', so 'D' is selected.) and What look up key from dataset one fetches 'D' from EVENT2 dataset two? I am assuming it is ID_category of one<--> For recommended event2 -> ID_event of dataset one ^= Event of dataset two -> recommended event2 ^= recommended event1 -> The order of priority is from top to bottom of dataset two In essence, I need you to explain me the look up operation of the logic with "keys" and priority clearly like what fetches what and why(priority). Thank you for your help, I think I have some ideas, I'll continue to try some methods. ^_^
... View more