Forum Discussion
Split and calculate
Hello.
I have items in the following packaging format. How do you split and calculate the total weight? Thanks.
Item #1 = 10X3KG = 30KG
Item #2 = 10X2X5KG (this means that 1 box has 10 packs of 2X5KG) = 100KG
RESULT TABLE
| ITEM # | TOTAL WEIGHT |
| #1 | 30 |
| #2 | 100 |
Oros , First Split in Power Query. text after delimiter, start from the end, and separate Number and KG part
Then split the first part again on delimiter X and Split the part two using Split by Digit and non digits
you will set 3 column, create a new column by multiplying them
Text Before Delimiter and Text After Delimiter: https://youtu.be/oGY4RoPKDOE
Split Column Power Query: https://youtu.be/FyO9Vmhcfag
Split Column By Digit to Non Digit & Non Digit to Digit: https://youtu.be/tY4Yk1crS9s
- Anonymous4 years ago
HI Oros,
You can merge the two columns that store the 'unit' of product and do replace operations on three value fields to replace null value with 1.
After these steps, you can simply calculate three value fields and merge them with the unit field to show the wanted results.
Replace values (Power Query) (microsoft.com)
Regards,
Xiaoxin Sheng
6 Replies
- amitchandak
Super User
Oros , First Split in Power Query. text after delimiter, start from the end, and separate Number and KG part
Then split the first part again on delimiter X and Split the part two using Split by Digit and non digits
you will set 3 column, create a new column by multiplying them
Text Before Delimiter and Text After Delimiter: https://youtu.be/oGY4RoPKDOE
Split Column Power Query: https://youtu.be/FyO9Vmhcfag
Split Column By Digit to Non Digit & Non Digit to Digit: https://youtu.be/tY4Yk1crS9s
- Oros
Post Prodigy
Hi amitchandak,
This created 4 columns with null values. Would it be possible for you to clarify the process again.
For example, I would like to get the total weight of 8X2X90 as 1,440 grams
and 4X450 as 900grams. How do I calculate when the split values as spread in 3rd and 4th column? Thanks.
- Oros
Post Prodigy
Hi amitchandak ,
After the split, how do I consolidate the column that looks like this now? How do I create a TOTAL WEIGHT column using the 5 columns? Thanks.
12X142GRAM, now in 3 columns (TOTAL WEIGHT=1,704)
6X20X30GRAM, now in 3 columns (TOTAL WEIGHT=3,600)
- Oros
Post Prodigy
Thanks amitchandak