Sort / Order columns of a dataset
UserBird
Dataiker, Alpha Tester Posts: 535 Dataiker
Can I reorder the column of a dataset, in the Explore view or the Prepare recipe?
Tagged:
Best Answer
-
You can now reorder column in a prepare recipe.
https://doc.dataiku.com/dss/latest/preparation/processors/move-columns.html
Answers
-
Generally speaking, there is not, unfortunately. You can however select the columns you want to display: when viewing a dataset, click the "Display" button in the upper right corner, then "Select displayed columns". You can also quickly scroll to another column by pressing the "C" key. Finally, you can highlight a line for easier comparison by pressing Shift+H while hovering the line.
As a side note, DSS will generally abide by the column order in the underlying storage's schema, so reordering the columns before importing the dataset is also a workaround. -
Hi,
Generally speaking, DSS does not have this feature.
You can however select the columns you want to display: when viewing a dataset, click the "Display" button in the upper right corner, then "Select displayed columns". You can also quickly scroll to another column by pressing the "C" key. Finally, you can highlight a line for easier comparison by pressing Shift+H while hovering the line.
DSS always show the columns in their "natural" order. You can thus also use a "Sync" recipe to achieve this, at the expense of duplicating your data. The sync recipe has two modes : "Strict schema equality", which maintains the input schema in the output, or "free schema". In that latter mode, you can edit the output schema to match what you want, and DSS will copy the columns from the input by their name.
Hope this helps, -
Use a SQL recipe and create a SELECT statement that selects the columns in the order you want -- this is best with SQL datasets. Or create Python or R recipes that do the same, although these run into problems with larger datasets. As with Clément's answer, this duplicates the dataset, but it's easy enough.
-
In DSS 4.3, the Move Columns processor (https://doc.dataiku.com/dss/latest/preparation/processors/move-columns.html) was added.