Split a row into several rows with almost same content. PowerQuery?

Iron Contributor

Difficult to explain by me as non native english speaker, but I'll give you an example

 

I have a table looking like this:

ArticleDescriptionPriceE1E2E3P1P2P3
1234FirstThingy100ABCDEFGHIJKL101001000
1235SecondThingy200MNOPQRST 210280 
1236ThirdThingy400  UVWX  15

 

 

Is itpossible with PowerQuery, to generate the following table?

 

ArticleDescriptionPriceExPx
1234FirstThingy100ABCD10
1234FirstThingy100EFGH100
1234FirstThingy100IJKL1000
1235SecondThingy200MNOP210
1235SecondThingy200QRST280
1236ThirdThingy400UVWX15

 

That is, based on a column in the row, duplicate the row, with all the values except the ones that are different?

Is that possible with PQ? And if yes, how?

 

(Background: I got an article list from a vendor that does have sub-vendors for some products. The product is the same, but the EAN number (E1,E2,E3) might be different from the sub-vendors. We need to track the goods based on the EAN code printed on the article. Since the same product might have different EAN numbers our ERP system would have to be able to differentiate between the EAN numbers and let them point to the same product. 

 

Just.. our ERP is not able to store and process more than one EAN number per product. The best solution I came up with is to split the vendors article list into several (almost identical) articles, each with the different EAN number, but the rest is the same.. 

 

Do I make sense?

 

Thanks for any hint

Dan

 

 

 

 

 

 

 

4 Replies

@DanHuber 

 

with sql,

 

//select * from Sheet1;

cli_unstack~Sheet1~E,P;

select colExclude[上层] from Sheet1_unstack where regexp('\w+',E);

 

https://www.bilibili.com/video/BV1VC4y1w7WN/?buvid=XX85E838539534AD650323D79CEE8DA100517&from_spmid=...

I unfortunately do not quite understand that solution.

It looks like this is an example on how to do it with SQL in a webapp?

I was looking for instructions on how to do this in Excel PowerQuery. Can this be done there too?

 

It looks like this is an example on how to do it with SQL in a webapp?
Yes.

this in Excel PowerQuery. Can this be done there too?

This M code works

https://answers.microsoft.com/en-us/msoffice/forum/all/how-to-automatically-create-a-new-row-with-da...

@DanHuber Try this (see attached).