Hi,
I am working with line by line transactional data. For example, for a single order, I have multiple rows (identified by an orderID column) with several columns of additional information. Specifically for my tasks, I will be dealing with the discount amount (number) and discount/promo code (text) columns. Thus, I have 3 objectives:
1. If there exists a discount amount in a row with a null or blank value in the adjacent discount/promo code column, insert a text value "Other Discount" to all rows within that same order (orderid). In other words, an order was placed with an unidentified discount code (text) provided.
1. Distribute a discount code (text) used in a purchase to all rows of the same order (with the same orderid). Currently, an order with 3 purchased items only includes the discount code on one of the rows. I need this text value replicated in each of the 3 line items or rows. (this is similar to my first task above)
2. Distribute the discount amount (number), which also only included in only 1 row for a multi-item rode, evenly across all ordered items so that when I aggregate all orders by OrderId, I will have a "net order revenue" number. For example, if a person orders 3 different items at $25 each, receives a $15 discount, I need each row to be reduced to $20.
This is my very first post on here so I hope I was clear in my explanations. Thank you in advance for your help!