Forum Discussion
Merge returning non existent values
- 8 years ago
The cause of your issue is a known phenomenon: if you sort a table and then use Table.GroupBy or Table.Distinct with the sorted table as source, the sort order is not necessarily maintained.
In your case, it means that the nested tables can have a different sort order then the original table.
Apparently you can even have different results in different queries.
The solution is to buffer the sorted table:
#"Sorted Rows" = Table.Buffer(Table.Sort(#"Replaced Values1",{{"HcmWorker_FK_PersonnelNumber", Order.Ascending},{"StartDateLeave", Order.Descending},{"EndDate", Order.Descending}})),
Hi CheenuSing,
Apologies for the delay in getting you this revised link!
Please find it here
https://drive.google.com/open?id=0B5coafxgNnpFNmktWXZFeXdnU2M
Any further questions please don't hesitate to ask.
Many Thanks
Trystan
The cause of your issue is a known phenomenon: if you sort a table and then use Table.GroupBy or Table.Distinct with the sorted table as source, the sort order is not necessarily maintained.
In your case, it means that the nested tables can have a different sort order then the original table.
Apparently you can even have different results in different queries.
The solution is to buffer the sorted table:
#"Sorted Rows" = Table.Buffer(Table.Sort(#"Replaced Values1",{{"HcmWorker_FK_PersonnelNumber", Order.Ascending},{"StartDateLeave", Order.Descending},{"EndDate", Order.Descending}})),
- Tcoe8 years agoFrequent Visitor
I really appreciate(you both) you taking your time to help me with this issue, in particular the work around that you have provided.
Hopefully MS can straighten out this 'known phenomenon',
Thanks again
Tcoe