Consolidate data rows using 3 conditions - newbie to power query

newuser17

New Member
Joined
Sep 12, 2018
Messages
13
Dear Experts,

i have 30000 rows of data which consist of around 40 columns. the rows have duplicate data. what i require is consolidate these duplicate data using 3 conditions and insert a parent data row containing same data as the child row. the 3 conditions to validate are:

1. Code
2. SKU
3. Size

and also there are 2 columns which have MSRP and SP, when we consolidating the data we need to take the maximum value available in both columns seperatly

i have attached a screenshot of raw data and desired outcome here with. i have ignored the columns that are not related to above 3 validation. but those columns need to be available in the out put. (in the screenshot please refer category and description)

54168a2e4f6b5c15d26eb73718a79238-full.png


Is this doable in power query ? because this raw data process is going to be recurring very often.... or even with a macro is doable. thanks in advance for your effort and time..

i am using excel 2016 and with no 365 subscription on a win 7 platform
 
Thank you very much sandy for your help. i haven't tried the yet, but it seems it will work fine.

but as you can see in my desired output table there is a additional row (parent) contains part of the data which is similar to an header for each child row. i am struggling to get it done by power query..

hope you got clear idea about the point.
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
You are welcome ;)

You've chance to try with additional row with (again) duplicated source table then append to the merged table (theory)

edit
something like this one?

SKUCategoryDescrptionSizeStockMSRPSP
OB581283-BlackComboABCOxford Embroidered Mini Dress
130​
37​
OB581283-BlackComboABCOxford Embroidered Mini DressL
2​
130​
37​
OB581283-BlackComboABCOxford Embroidered Mini DressM
2​
130​
37​
OB581283-BlackComboABCOxford Embroidered Mini DressS
1​
130​
37​
OB581283-BlackComboABCOxford Embroidered Mini DressXS
5​
130​
37​
OB581283-LilacComboABCOxford Embroidered Mini DressL
1​
130​
37​
OB581283-LilacComboABCOxford Embroidered Mini DressM
1​
130​
37​
OB581283-LilacComboABCOxford Embroidered Mini DressS
4​
130​
37​
OB581283-LilacComboABCOxford Embroidered Mini DressXS
3​
130​
37​
OB581283-NeutralComboABCOxford Embroidered Mini DressL
2​
130​
37​
OB581283-NeutralComboABCOxford Embroidered Mini DressM
5​
130​
37​
OB581283-NeutralComboABCOxford Embroidered Mini DressS
3​
130​
37​
OB581283-NeutralComboABCOxford Embroidered Mini DressXS
1​
130​
37​
 
Last edited:
Upvote 0

thanks for your prompt reply. yeah that is the table i need. i am still very new to power query and trying to understand the duplicating table process. and i was unable to download the excel file.. can you please post it anywhere else ? if i have the sample file and have the code side by side i might be able to understand it fully.
 
Upvote 0
thanks for your prompt reply. yeah that is the table i need. i am still very new to power query and trying to understand the duplicating table process. and i was unable to download the excel file.. can you please post it anywhere else ? if i have the sample file and have the code side by side i might be able to understand it fully.

oops sorry!!! the table you posted is correct except the first cell. for the parent row, SKU column should have Code, not the SKU sorry for the confusion.
 
Upvote 0
this is shared file, try three dots on very right side of menu, there should be download option.

btw. I am lazy so I simple added next duplicate instead creating everything from the begining

edit:
so stay with Code instead of SKU, this is a child's play ;)
 
Last edited:
Upvote 0
this is shared file, try three dots on very right side of menu, there should be download option.

i am having a bad luck with this, i was able to download but its in mhtml format and unable to open in excel 2016. also i hope the ondrive is blocked by internal firewall.


btw. I am lazy so I simple added next duplicate instead creating everything from the begining edit: so stay with Code instead of SKU said:
i am not getting this point. means have you changed the codes in the file or do you want me to figure it out ? sorry to keep you bothering.
 
Upvote 0
ok, here is the example file with correction: download


CodeCategoryDescrptionSizeStockMSRPSP
OB581283ABCOxford Embroidered Mini Dress
130​
37​
OB581283ABCOxford Embroidered Mini DressL
2​
130​
37​
OB581283ABCOxford Embroidered Mini DressM
2​
130​
37​
OB581283ABCOxford Embroidered Mini DressS
1​
130​
37​
OB581283ABCOxford Embroidered Mini DressXS
5​
130​
37​
OB581283ABCOxford Embroidered Mini DressL
1​
130​
37​
OB581283ABCOxford Embroidered Mini DressM
1​
130​
37​
OB581283ABCOxford Embroidered Mini DressS
4​
130​
37​
OB581283ABCOxford Embroidered Mini DressXS
3​
130​
37​
OB581283ABCOxford Embroidered Mini DressL
2​
130​
37​
OB581283ABCOxford Embroidered Mini DressM
5​
130​
37​
OB581283ABCOxford Embroidered Mini DressS
3​
130​
37​
OB581283ABCOxford Embroidered Mini DressXS
1​
130​
37​
 
Last edited:
Upvote 0
hello there..

i know this is too late. the thing is i have got the result what i wanted. thanks for sandy to enlighten me the group and append concept. i was never thought about that. and then i have customized it according to my requirement by replacing values.

here is the sample file that i modified sandy's answer.

http://s000.tinyupload.com/index.php?file_id=88051951309658784279

thanks for sharing your knowledge with me..
 
Upvote 0

Forum statistics

Threads
1,214,415
Messages
6,119,382
Members
448,889
Latest member
TS_711

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