Using PowerQuery in Excel 2016 to combine words in one column by the Category stored in another column. I use GroupBy with Text.Combine in it. I am expecting the order of words to be sustained but it seems random.
There are 3 pictures below
first is my original table before SORT.
MAPPED WORDS is what i need combined, CATEGORY is the bucket of the combinations, POSITION is the column which indicates the position of MAPPED WORD in SKU - i sort words in that order expecting that Text.Combine would retain that in the final strings. I am interested in red and blue-highlighted words for this example.
ORIGINAL TABLE
Market Tag SKU Position Category Mapped Word
ABG 130 HELLO DAY CRYSTAL MIDI GRANOLA CHOCOLATE 11 BRAND Crystal
ABG 130 HELLO DAY CRYSTAL MIDI GRANOLA CHOCOLATE 7 BRAND Day
AAI 30 FINAX HEALTHY GOOD MUESLI APPLE NUT RAISIN 1 BRAND Finax
AAI 30 FINAX HEALTHY GOOD MUESLI APPLE NUT RAISIN 7 OTHER Healthy
ABG 130 HELLO DAY CRYSTAL MIDI GRANOLA CHOCOLATE 1 BRAND Hello
ABG 130 HELLO DAY CRYSTAL MIDI GRANOLA CHOCOLATE 19 BRAND Midi
AAI 30 FINAX HEALTHY GOOD MUESLI APPLE NUT RAISIN 20 TYPE Muesli
AAI 30 FINAX HEALTHY GOOD MUESLI APPLE NUT RAISIN 33 FLAVOURS Nuts
AAI 30 FINAX HEALTHY GOOD MUESLI APPLE NUT RAISIN 37 FLAVOURS Raisins
ABG 130 HELLO DAY CRYSTAL MIDI GRANOLA CHOCOLATE 32 FLAVOURS Chocolate
AAI 30 FINAX HEALTHY GOOD MUESLI APPLE NUT RAISIN 27 FLAVOURS Apple
ABG 130 HELLO DAY CRYSTAL MIDI GRANOLA CHOCOLATE 24 TYPE Granola
AAI 30 FINAX HEALTHY GOOD MUESLI APPLE NUT RAISIN 15 BRAND Good
AFTER SORT
AFTER GROUPBY-COMBINE.
The problem is that the result does not look like any logic - the order is ignored. Red words are appended in alphabetical order, whilst blue with no specific order.
I need the words combined in the order as per POSITION column.