Merging multiple rows based on criteria

andrey111

New Member
Joined
Nov 2, 2020
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi,

could you please assist solving the following tasks:

1) F.e. I have data set:

BrandSKUDiscount
1cream10%
1oil10%
2detergent20%
2tabs15%

What i need - to create a task with description, which discounts need to be check. It should be in following format though:
SKU within same brand with same discount depth should be merged into 1 row - Check Discount 10% for brand 1 for SKU's: cream & oil.

While others should remain as same rows as they have different discounts within brand:

Check Discount 20% for brand 2 for SKU detergent
Check Discount 15% for brand 2 for SKU tabs.


There is more levels of data, f.e. the task should be within same outlet (if there is x > 1 outlets, task will be multiplied by x according to amount of outlets). But I guess it should be easy further on if I get the method how to do the mentioned above task.


2) Should be pretty similar to the previous one, but I might be wrong

BrandSKUMonitorCatalogue
1cream01
1oil10
2detergent01
2tabs10

Monitor & Catalogue columns basically describe which rows can be merged. So the output out of this table should be 2 rows:

1) Check positioning of 1-oil and 2-tabs on the monitor
2) Check positioning of 1-cream and 2-detergent on the catalogue

There can be multiple levels of aggregation, i.e. on top of rows with 1's, there can be rows with 2's - meaning they should be merged in separate task as well. 0 in all cases means - don't take.

I understand it might be a little bit overcomplicated, but i'm looking to speed up this process in Power Query as it's currently being done with VBA analyzing each row and finding match positions.


Thank you!
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,223,760
Messages
6,174,341
Members
452,555
Latest member
colc007

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top