Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8667

If an order line has multiple deals then put them in different columns

$
0
0

I have a situation where an order has multiple items and these items may have multiple deals attached to it.  Right now my join is creating multiple lines and the totals on Qty and Sales are incorrect

 

Order:          Item          Qty     DealNo                                     DiscountAmt           Price       Sales

111              A                 1       EmployeeDiscount 10%          1.00                         10.00       10

111              A                 1       Monthly Promo        20%         2.00                         10.00       10

 

Total                                2                                                          3                                            20.00

 

It should look like this:

Order:          Item          Qty     DealNo                                     DiscountAmt           Price     sales

111              A                 1       EmployeeDiscount 10%          1.00                         10.00      10

111              A                 1       Monthly Promo 20%                2.00                         10.00      10

 

 

Total                               1                                                        3                                            10




Or perhaps CrossTab will look cleaner?


Thanks.


Viewing all articles
Browse latest Browse all 8667

Trending Articles