Forum Discussion
how do you remove columns in query editor
- 8 years ago
Hi Ehab,
1. If you want to delete some columns, you can also do it in the Data or Report pane.
2. There is a view of all the columns in the Query Editor.
Best Regards!
Dale
Hi Ehab,
1. When you enter the query editor just select the column you want to delete (like in my picture below)
2. You can also select all columns you want to keep and press remove other columns (you can select multiple by holding CTRL)
When you delete it in query editor it will also be deleted from the report view.
Regards,
L.Meijdam
thanks,
i was just wondering if there was an easy view as in the report menu shown below ... when you have 30+ columns and you only want a handful, the approach you mention is very time consuming (apologies on the screen shot ... blocked out much of it below for confidentiality reasons ... there are 30+ fields ... being able to scroll quickly and check the ones i want is very convenient
- Greg_Deckler8 years ago
Community Champion
You can also hold down Shift or maybe Ctrl key to select the columns you want and then right click and remove other columns.
- poifish8 years agoNew Member
I don't know if you still need to know a way to easily select the columns you want but next to <Remove Columns> there is <Choose Columns> which allows you to selct the columns you would like to keep shown in a list format
- poifish8 years agoNew Member
I dont know if you know this already so I thought i would just put it out there but next to <Remove Columns> there is <Choose Columns> which provides an easy view for you to select which columns you would like to keep
- wknelson8 years ago
Advocate II
Another way to remove multiple columns is to use the editor.
First delete a column. In the equation box find the name of previous step in the string. In the case below the previous step was #"Sorted Rows"
= Table.RemoveColumns(#"Sorted Rows",{"PF-3_MS-3_16"})
Now replace the entire string with the one below using the name of your previous step. Replace the leading characters of the row/s you want deleted with the "PC" below and/or replace "search" with your search string that you want to find. This will remove all columns containing your designated characters.
= let columnsToRemove = List.Select(Table.ColumnNames(#"Sorted Rows"),each Text.StartsWith(_,"PC")or Text.Contains(_, "search")) in Table.RemoveColumns(#"Sorted Rows", columnsToRemove)