Hi All,
I need to report how many times we used Promo Code X, Y, or Z for how many of each product A, B, C...
Data-set will contain about 10,000 records each month and whatever solution I find will need to be run on up to 5 Promos per month.
Here is my quandry:
If the current record's 'prod_id' = "107", I need to look at each record where 'invh_no' is same as current record and 'data_field' is equal to current record's ('data_field' * -1.0) and then report a total 'qty' of each 'prod_id' = "107" broken down by the 'prod_desc' from those matching records.
It seems so confusing explained this way but here is some example data and what the results should be:
<colgroup><col width="131" style="width:98pt" span="6"> </colgroup><tbody>
</tbody>
Promo X (107) =
Product A = 6
Product C = 2
Product D = 2
Hope that isn't too terribly vague - Any help would be greatly appreciated...
I need to report how many times we used Promo Code X, Y, or Z for how many of each product A, B, C...
Data-set will contain about 10,000 records each month and whatever solution I find will need to be run on up to 5 Promos per month.
Here is my quandry:
If the current record's 'prod_id' = "107", I need to look at each record where 'invh_no' is same as current record and 'data_field' is equal to current record's ('data_field' * -1.0) and then report a total 'qty' of each 'prod_id' = "107" broken down by the 'prod_desc' from those matching records.
It seems so confusing explained this way but here is some example data and what the results should be:
invh_date | invh_no | quantity | prod_id | prod_desc | data_field |
7/10/2017 | 561712 | 4 | 107 | Promo X | -31.95 |
7/10/2017 | 561712 | 1 | 550 | Delivery | 2.45 |
7/10/2017 | 561712 | 8 | AAAA | Product A | 31.95 |
7/3/2017 | 564131 | 2 | 107 | Promo X | -21.50 |
7/3/2017 | 564131 | 1 | 550 | Delivery | 2.00 |
7/3/2017 | 564131 | 4 | BBBB | Product B | 15.00 |
7/3/2017 | 564131 | 4 | CCCC | Product C | 21.50 |
7/3/2017 | 564250 | 2 | 107 | Promo X | -30.50 |
7/3/2017 | 564250 | 1 | 550 | Delivery | 2.45 |
7/3/2017 | 564250 | 4 | DDDD | Product D | 30.50 |
7/19/2017 | 569703 | 2 | 107 | Promo X | -16.50 |
7/19/2017 | 569703 | 1 | 550 | Delivery | 2.45 |
7/19/2017 | 569703 | 4 | BBBB | Product B | 15.00 |
7/19/2017 | 569703 | 1 | EEEE | Product E | 45.00 |
7/19/2017 | 569703 | 1 | FFFF | Product F | 45.00 |
7/19/2017 | 569703 | 4 | AAAA | Product A | 16.50 |
7/19/2017 | 569703 | 1 | HHHH | Product H | 30.50 |
<colgroup><col width="131" style="width:98pt" span="6"> </colgroup><tbody>
</tbody>
Promo X (107) =
Product A = 6
Product C = 2
Product D = 2
Hope that isn't too terribly vague - Any help would be greatly appreciated...