google-query-language

Trying to include additional columns in QUERY result on GoogleSheets

我是研究僧i 提交于 2019-12-25 09:38:12
问题 I'm using Google Sheets and using the following formula without any issue: =QUERY(Sheet!A:D,"select A, max(B) where not B is null group by A label A 'Client', max(B) 'Most Recent'") Obviously, this is returning columns A and B of the referenced data However, I would like to also return the corresponding cells from column C. sample data: https://docs.google.com/spreadsheets/d/1CJKiDNPUWMMUbLLb-UDA6iRA2PBnlMHDsEB9vELe0Rk/edit?usp=sharing Using this example, what I would like to see is cell G2

Google Sheets Query Language, return 0

夙愿已清 提交于 2019-12-25 08:14:19
问题 I've been having troubling getting the query function to return 0 when the queried data isn't found. Given the following data... With each sheet being a different player, I need to count the number of games each played and the outcome of those games. Some players may be in the same game as each other so the gameIDs are given as a unique identifier so those games are only counted once, that part I have working. What I'm trying to do now is record the number of wins team A has in each room. You

Fastest way to search for a row in a large Google Sheet using/in Google Apps Script

元气小坏坏 提交于 2019-12-23 20:15:45
问题 Disclaimer: I already have the answer and am posting here to share what I learned. GAS is quite powerful and you could write a full fledged web-app using a Google Sheet as the DB back-end. There are many reasons not to do this but I figure in some cases it is okay. I think the biggest issue will be performance issues when looking for rows based on some criteria in a sheet with a lot of rows. I know there are many ways to "query" a sheet but I can't find reliable information on which is the

sum value from a date range for a specific product

丶灬走出姿态 提交于 2019-12-20 06:41:03
问题 I am looking to sum up multiple values from multiple cells where they will match a date and a product. like below: I have a date set in every cell in row 2 as below, and I have my categories in column A now I want to pick the total value (that is unit costs) from (below picture) this sheet where the date is equal to 1-dec (date) and the category is equal to office. I tried using this formula ( =sum(query(DataSheet!A3:J10, "select a,c,i where a= '"&C2&"' and c= '"&A4&"'",0),0) ) - but it is

Google SpreadSheet Query: Can I remove column header?

為{幸葍}努か 提交于 2019-12-18 10:14:41
问题 I'm doing this query at my google spreadsheet: =QUERY(H4:L35;"select sum(L) where H='First Week'"; -1) But it returns a little table with "sum" as header and result below it. What I want is just the result! How I remove header? Can I? 回答1: Try this: =QUERY(H4:L35,"select sum(L) where H='First Week' label sum(L) ''") Hope that Helps! 回答2: =QUERY(QUERY(A1:D, "SELECT *", 1), "SELECT * OFFSET 1", 0) The outer query: "SELECT * OFFSET 1" excludes the first row (the header). The inner query

Google Sheet Query - Group / concatenate multiple rows

别说谁变了你拦得住时间么 提交于 2019-12-13 02:26:51
问题 I'm running a pretty simple query with a sum and group by, but I'd like to aggregate multiple distinct values from the rows into a single row and column. I've looking to concatenate all those values together. Take a look at my sample; https://docs.google.com/spreadsheets/d/1GcYbwAujKQFpolTQb9h35mlP5mxmeiWJmPnp4OemNuU/edit?usp=sharing I have my query in F1 and the desired output in F11. 回答1: You can use the filter and join functions to help: To get a unique list of names: =UNIQUE(A3:A) To join

Creating a table using google app script from a query

霸气de小男生 提交于 2019-12-13 00:44:44
问题 I have successfully been able to create a google chart by querying a google sheet that I have. I'm trying to create a table by querying the same google sheet, but I'm not getting any results. I know I'm doing something wrong, but I'm not sure what it is :/ Here's the code below: <html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("visualization", '1', {packages:['table']}); google.setOnLoadCallback(drawTable);

Exact result in Google Query, followed by partial match if exact result does not exist

跟風遠走 提交于 2019-12-12 05:28:16
问题 I'm using Google Query to search a Google Spreadsheet: https://jsfiddle.net/BaronGrivet/ctkpvuac/3/ Example Data: Block Hill Road Greenhill Road Hill Road Brownhill Road Example Query: 'SELECT A WHERE LOWER(A) LIKE "%'+searchInput+'%" ORDER BY A ASC' If someone searches for "Hill" it will return all of the rows. However if someone searches for "Hill Road" it will still return all of the rows with "Hill Road" listed last. Ideally I want it to either only return the exact match "Hill Road", or

Splitting row in 2 columns

依然范特西╮ 提交于 2019-12-11 17:45:58
问题 Trying to get data split by language where '/' delimiter is present used this query it works but when there is no '/' it the row goes to the french column i want the french column to be null if there is no '/' and the data should go in English column. It is sorted by site id so only id 412 has the french in it. SELECT s.siteid, s.notes, --This is the column that CSI uses for the description. split(s.notes,'/') [safe_OFFSET(0)] French, split(s.notes,'/') [safe_OFFSET(1)] english FROM

Google Spreadsheets: How to query countries with max population by continent?

梦想与她 提交于 2019-12-11 07:03:29
问题 Let's say I have a table with the columns country, continent and population. How can I use the QUERY function in Google Spreadsheets to select, for each continent, only the country with the highest population? In regular SQL I think I'd use HAVING, but this doesn't seem to be an option here. 回答1: =SORTN(SORT(G:J,4,0),2^99,2,3,0) SORT by population in descending order,if not done already Remove Duplicates with SORTN 回答2: I suggest a helper column, say K with: =if(maxifs(J:J,I:I,I2)=J2,"#","")