Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
10 years ago

editing queries

Hello,

 

I have a query that I need to edit, but it does not know how to do this, the query you want to edit is this:

 

= Fonte{[Item="FTEGF_EmpenhoPago",Schema="dbo",Catalog="TeresinaDw"]}[Data]

 

I want to apply a filter to it.

 

is it possible to do that?

5 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    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.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Okay, but I have doubts as syntax to be used, I want to add a filter that query

      • Greg_Deckler's avatar
        Greg_Deckler
        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"