S
spartanmba
Hello,
I have a table with the follow data:
Store Quarter Month Sales Percent ID
245 2 5 3.5% 110
245 2 6 3% 111
245 2 7 5% 243
245 2 12 8% 249
245 3 7 4.5% 302
245 3 8 4% 303
245 3 12 6% 310
I would like the result set to return this:
Store Quarter Month Sales Percent ID
245 2 5 3.5% 110
245 2 6 3% 111
245 3 7 4.5% 302
245 3 8 4% 303
245 3 12 6% 310
I think I know what the query needs to do, but I have no idea how to
approach it. I am thinking that the query would take an individual record
(id 243 in this case) and see if it is the highest quarterly information in
the table while keeping the store number and month the same. To give a
little more insight, the data in the table is actual and forecasted percents.
For example, record 310 is a forecasted amount during the third quarter for
month 12 which is in the fourth quarter. I would want 310 to appear in my
result set until sometime in the fourth quarter when a data point for month
twelve was added.
Thanks for your help,
John
I have a table with the follow data:
Store Quarter Month Sales Percent ID
245 2 5 3.5% 110
245 2 6 3% 111
245 2 7 5% 243
245 2 12 8% 249
245 3 7 4.5% 302
245 3 8 4% 303
245 3 12 6% 310
I would like the result set to return this:
Store Quarter Month Sales Percent ID
245 2 5 3.5% 110
245 2 6 3% 111
245 3 7 4.5% 302
245 3 8 4% 303
245 3 12 6% 310
I think I know what the query needs to do, but I have no idea how to
approach it. I am thinking that the query would take an individual record
(id 243 in this case) and see if it is the highest quarterly information in
the table while keeping the store number and month the same. To give a
little more insight, the data in the table is actual and forecasted percents.
For example, record 310 is a forecasted amount during the third quarter for
month 12 which is in the fourth quarter. I would want 310 to appear in my
result set until sometime in the fourth quarter when a data point for month
twelve was added.
Thanks for your help,
John