power query, vlookup (left join) unwanted sort

nikio8

Board Regular
Joined
Oct 20, 2017
Messages
128
Hi all, thanks for your help in advance.

I get this weird error. I am joining a list (lookup) to a table (result).
Using pq to save time and not need vlookup on each Result table, however it is no good that the result is sorted. I am not sure why this happens, Lookup table is connection only... ? There are no extra rows - no duplication in result table.



Lookup
Result .
11
21
31
11
22
32
12
22
33
13
23
33

<colgroup><col span="2"><col></colgroup><tbody>
</tbody>
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
RLDescriptionJoinJoinTable7.RLTable7.Description
1One111One
2Two211One
3Three322Two
4Four122Two
5Five233Three
333Three
111One
222Two
333Three
111One
222Two
333Three

<tbody>
</tbody>
 
Upvote 0
try this way
- add index to both tables
- merge these tables as you did
- sort by index
- remove unnecessary columns
- load to the sheet

I didn't remove index to show how it works

IndexJoinTable1.RLTable1.Description
1​
1​
1​
One
2​
2​
2​
Two
3​
3​
3​
Three
4​
1​
1​
One
5​
2​
2​
Two
6​
3​
3​
Three
7​
1​
1​
One
8​
2​
2​
Two
9​
3​
3​
Three
10​
1​
1​
One
11​
2​
2​
Two
12​
3​
3​
Three
 
Last edited:
Upvote 0
Thanks Sandy. That will work, but this glitch is strange.
On my second try i got:
112233 123 123.
Really weird. Would be nice to know why this happens.
 
Upvote 0
did you do it all in PQ Editor?

could you post sample data (source) in table(s) form?
 
Upvote 0
did you do it all in PQ Editor?

could you post sample data (source) in table(s) form?
Hi Sandy, that was the entire data. I made two tables and used left join instead of lookup. that was the result. 123 123 123 so I can see the pattern. i was not expecting 111 222 333.
Do you not get the same?
 
Upvote 0
That will work, but this glitch is strange.
On my second try i got:
112233 123 123.

I did it again and got the same, proper result

JoinIndexTable2.RLTable2.DescriptionTable2.Index
1​
1​
1​
One
1​
2​
2​
2​
Two
2​
3​
3​
3​
Three
3​
1​
4​
1​
One
4​
2​
5​
2​
Two
5​
3​
6​
3​
Three
6​
1​
7​
1​
One
7​
2​
8​
2​
Two
8​
3​
9​
3​
Three
9​
1​
10​
1​
One
10​
2​
11​
2​
Two
11​
3​
12​
3​
Three
12​

Code:
let
    Source = Table.NestedJoin(Table1,{"Index"},Table2,{"Index"},"Table2",JoinKind.LeftOuter),
    #"Expanded Table2" = Table.ExpandTableColumn(Source, "Table2", {"RL", "Description", "Index"}, {"Table2.RL", "Table2.Description", "Table2.Index"})
in
    #"Expanded Table2"
 
Upvote 0

Forum statistics

Threads
1,215,340
Messages
6,124,386
Members
449,155
Latest member
ravioli44

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top