Google Spreadsheets QUERY() to combine multiple sheets, same workbook

后端 未结 4 2190
挽巷
挽巷 2021-02-08 05:52

Goal: I\'m using QUERY() in gSheets to combine data from multiple sheets in the same workbook. The data is an extract from GA broken down into small segments to

相关标签:
4条回答
  • 2021-02-08 06:15

    Figured out to how sort by column using the formula above:

    =SORT(QUERY({'LandingPages-Oct1'!A16:F; 'LandingPages-Oct2'!A16:F}, "where Col1 <>''"),1,TRUE)
    

    This will sort by column 1.

    0 讨论(0)
  • 2021-02-08 06:22

    Semicolon separating sheets causes the first sheet of data to appear, but not the second

    This usually means you didn't scroll to the bottom of the sheet to see the second part of data there, under all of the empty rows from the first sheet.

    Since you probably don't want to import the empty rows, filter them out (by some column that is expected to be nonempty):

    ={filter('LandingPages-Oct1'!A16:F, len('LandingPages-Oct1'!A16:A));
      filter('LandingPages-Oct2'!A16:F, len(LandingPages-Oct2'!A16:A))}
    

    No need for query at all; query string "select *" means you are not really querying.

    0 讨论(0)
  • 2021-02-08 06:32

    In regards to:

    ^ Semicolon separating sheets causes the first sheet of data to appear, but not the second

    Reason for me why this did not work initially, was that the format of the two tables were not the same. After pasting the same format this worked again.

    0 讨论(0)
  • 2021-02-08 06:35

    Alternatively, you can also use query to remove the empty rows

    =QUERY({'LandingPages-Oct1'!A16:F; 'LandingPages-Oct2'!A16:F}, "where Col1 <>''")
    
    0 讨论(0)
提交回复
热议问题