Forum Discussion
Split one row into two rows
Hi Stachu,
In Salesforce, we created the packages also as 1 product, so it's not in the system (at this moment).
At this moment (en at least for the comming 24 months), we only have 2 packages:
- ACN+ for DRY SKIN
- 1 ACN+ Wash
- 1 ACN+ Cream
- ACN for NORMAL TO OILY SKIN
- 1 ACN Wash
- 1 ACN Cream
So, I hope this creates an opportunity *cross the fingers*
so it's basically custom mapping solution
in Query Editor create a new query and paste the following code
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnT201ZIyy9ScAmKVAj29vRT0oGIhScWZyjF6uBR4VyUmpgLUwJW4ecf5OvooxDir+Dv6YOsGMU0AkqhxsYCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Combined = _t, Single = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Combined", type text}, {"Single", type text}})
in
#"Changed Type"it would be better if you use product codes rather than names
merge your data table with the one above, with left outer join on Name -> Combined (or on respective product codes )
expand the name (or code) of single Products
in your data table create a new column, with following code (again you may want to replace [Name] with the product code
if [Single] = null then [Name] else [Single]
- dennisdepoorter7 years agoHelper I
Thanks for the reply...
I made some changes in Salesforce and added a extra table (product component) --> make us more future proof :smileyvery-happy:
The problem is now, I don't get my quantity how I want it... He gives for every product the same quantity instead of the quantity for each product (see picture below)...
- Stachu7 years agoCommunity Champion
what's the definiton of the [Measure]?
- dennisdepoorter7 years agoHelper I
Quantity = SUM('Order Product'[Quantity])De sum of quantity on order product (where order product is the table wit all the orders on product level),... but don't know if this will work.