Pages: [1]
  Print  
Author Topic: matching datasets according to best ranked item  (Read 18 times)
vabm
Newbie
*
Posts: 4


« on: February 06, 2016, 01:10:10 PM »

Hi, I have two data sets that I need to match according to some specific value.
The first one (table 1) contains the IDs of a set of products, and the performance of these product according to the age of a user, something like:
Code:
item_id, user_age, item_performance
01, 45, 2
02, 23, 4
03, 23, 3
04, 45, 5
etc

Then, the other one (table 2) has the age of a set of users, like:

Code:
user_id, age
001, 45
002, 23
003, 29
(etc)

What I need to do is to find the item that has the best performance for each age group, and then match them as a single dataset. Samething like:

Code:
user_id, item_id
001, 04
002, 02
003, 06
(etc)

I was trying to use aggregate to find the best score per age, but I am getting the best scores for a single age group... any ideas on how to find the best scores per age group, and then how to aggregate them to table 2? Thanks !!
Logged
Pages: [1]
  Print  
 
Jump to: