Forum Discussion

DanHuber's avatar
DanHuber
Iron Contributor
Dec 06, 2023

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

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

Resources