Forum Discussion
editing queries
On Home tab, click Edit Queries. This will open a new window with your queries listed down the side, pick the query you want and insert or add steps.
- Anonymous10 years agoNot applicable
Okay, but I have doubts as syntax to be used, I want to add a filter that query
- Greg_Deckler10 years ago
Community Champion
So, in the query editor, select the query. Find the column that you want to filter on. Click the drop-down arrow on that column and uncheck the particular things that you want to filter out. Here is an example query with the last step being a filter operation. This is one type of filter operation but you can also use the interface to do things like remove blank rows, remove duplicates, remove errors, only keep the top or bottom rows, etc.
let Source = Csv.Document(File.Contents("C:\temp\azureml\SF_Incident_Data_Prepped.csv"),[Delimiter=",", Columns=15, Encoding=1252, QuoteStyle=QuoteStyle.None]), #"Promoted Headers" = Table.PromoteHeaders(Source), #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"IncidntNum", Int64.Type}, {"Category", type text}, {"DayOfWeek", type text}, {"Date", type date}, {"Time", type time}, {"PdDistrict", type text}, {"Resolution", type text}, {"Address", type text}, {"X", type number}, {"Y", type number}, {"Location", type text}, {"Resolved", Int64.Type}, {"Month", Int64.Type}, {"Year", Int64.Type}, {"Hour", Int64.Type}}), #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([DayOfWeek] <> "Monday")) in #"Filtered Rows"- Anonymous10 years agoNot applicable
Thanks, but Greg_Deckler is running some error with my script, what am I doing wrong?
let
Source = Odbc.DataSource ("dsn = DwProd"), FTEGF_Iniciativa_dbo_TeresinaDw Source = {[Item = "FTEGF_Iniciativa" Schema = "dbo" Catalog = "TeresinaDw"]} [Date] Filtered Rows FTEGF_Iniciativa_dbo_TeresinaDw.Exercicio_Movimento_ID => Exercicio_Empenho_ID
inFTEGF_Iniciativa_dbo_TeresinaDw Filtered Rows
Filtered Rows