Hi,
I would like to have the same order of rows in PQ result table (spe\readsheet Baza) vs source table Sales_New (spreadsheet Sales_New). Is it possible to make it directly in PQ?
pls find the file attached
Hi,
I would like to have the same order of rows in PQ result table (spe\readsheet Baza) vs source table Sales_New (spreadsheet Sales_New). Is it possible to make it directly in PQ?
pls find the file attached
you can add an index on the source data and sort it at the resulting table?
I cannot check it because I cannot read a part of your queries and something is missing too
hi,
yes, I was thinking about that. but I would have to sort both tables each time by hand. If that was me, it would not be a problem, but this file will be used by few other guys and they might forget it. The source table might have different numbers of rows each week, so it is dynamic and sort will be done in different columns. So, this could be not perfect solution.
I am looking for something automatic, to be done on a spot
file attached once again, hope it will work now
The SalesNew query should load in the same order as your source table, so you add the Index in PQ. You can then sort on that at the end.
Rory
hi,
I know that Sales_New should have that column with numbers. however, this table will change and can be sorted by different people on diffrent columns (+ new rows will appear constantly) , so in the end it will not be sorted in sequence of "1, 2, 3, ..."
Therefore, is there any possibility that the order of the final table is the same as Sales_New and does not matter what way was Sales_New sorted?
Did you try it? If you add the index column in Power Query, the numbers will always be in the same order as the source table when the query is refreshed.
yes, attached.
However, the problem appears when Sales_New is not sorted in the first place, just before refresh. If it is sorted in a way of "1,2,3...", I have the required outcome (problem solved), but if it is randomly sorted, it does not go in the same order when refresh with PQ.
The reason I need to do it, is because the results from the final table has to be copied in the same order as Sales_New to other table (which always will be in the same order as Sales_New). sorry, if it is to complicated
P.S. I caanot use any VBA nor PQ in that last stage (that is copy/paste), because it will be done in different tables/files, etc.
You've misunderstood. You do not add the index numbers to the SalesNew table. You add it in Power Query.
Please try below M code
the key is to use Table.Buffer() before Expanded Reordered Columns
Please Login or Register to view this content.
looks promising let me check that for a day
thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks