Filter GetRows on GoogleSheet Document via Logic Apps - google-sheets

I am reading from a google sheet of 100,000+ records but I want to load only the records after a certain date. ( so applying filter ) . But I haven't been able to accomplish that as I do not know how to access the column name without using foreach.
Here is what the data looks like from the googlesheet
So basically, I would like to filter the records something like this.
Timestamp ge '10/13/2021' so it will only return records for 10/13/2021 and 10/14/2021... etc.
Is this possible to do that? If not, what is the best recommended way to approach this issue as i just wanted to load daily records to sql db in the next step.

The Get rows action of the Google Sheets connector doesn't support filtering. You can only specify how many rows you want returned, and how many rows you want to skip. E.g. if you have 100,000 rows in your sheet, you can easily get the rows between 90,001 and 90,200, should you wish to do so.
While you can't use this connector to retrieve filtered data from Google Sheets, you can use the Filter array action to filter the retrieved data as you wish.
You might still need to use the For each loop to retrieve and filter data in chunks.

Related

combine data from selected sheets

I have a spreadsheet that has a lot of sheets of data grouped by category. I have a main sheet that I want a user to be able to choose which categories of data to use, and it will pull that data into one long list.
Here is an example spreadsheet of what I want to do: LINK TO SHEET
I could combine all the data into one spreadsheet, but if I were to do that with the dataset I am working with, I would have tens of thousands of rows. So, having the data stored on separate sheets is preferred. I am open to having separate spreadsheets altogether if that will make it easier. Currently, I have tried Using INDIRECT and QUERY, but can only get the first sheet of data to show.
I would prefer to stick to normal functions, but could jump into appscript if I need to create a custom formula
I have tried using INDIRECT and CONCAT, and can get the first set of data, but not subsequent data. Also tried wrapping it in a query like this:
=QUERY({ARRAYFORMULA(INDIRECT(CONCAT(A2:A,"!a2:z100"))},"select * where Col1 is not null",1))
Splitting it up into separate spreadsheets, I was able to use the function:
=QUERY({ARRAYFORMULA(IMPORTRANGE(B2:B,"A1:Z10"))},"select * where Col1 is not null",1)
But it also would only pull the first set of data, not the subsequent rows.
All of this was me first attempting to get the information, not getting the information filtered by the sheets that were checked as well. I am pretty familiar with appscript as well and open to appscript solutions, but would prefer to stay away from it if possible.
You do not need additional column. Use REDUCE() with few other formula-
=REDUCE(HSTACK("Dataset Name","Data 1","Data 2","Data 3","Data 4"),FILTER(A2:A,B2:B=TRUE),
LAMBDA(x,y,VSTACK(x,QUERY(INDIRECT(y&"!A2:E"),"where A is not null"))))

Sorting QUERY output alongside user entered data in Google Sheets

I'm having trouble thinking about how to sort the results of a google sheets function alongside user entered data in adjacent cells.
Example sheet: https://docs.google.com/spreadsheets/d/1YfV93o8WEEgSG19WhbKOH1JBX5uIIz9YKVQLWSoA_Ik/edit?usp=sharing
For example, I've performed a case insensitive search function on a full list of raw data in columns Q to T using
=QUERY(Q:T, "WHERE (LOWER(Q) contains '"&LOWER(C12)&"')",2)
Image of implementation
This fills columns B,C,D,E as desired. In columns F,G I would like users to be able to add their name and the quantity of items they would like sent to them. I can sort the query results (let's say alphabetically by B) by just encapsulating it in SORT() or adding "order by" in the query, but the user entered data in columns F,G is not sorted along with this. Please could I have some ideas on how to achieve this? I'm at a loss after searching for existing questions.

How to change textual data into neumerical data in google sheets?

I am relatively very new to the google sheets and excel, there is a task I need to perform.
I have a google form, that is taking user response and storing Data in a google sheet, the values are textual verbiage and I want to change this to corresponding numerical data.
What I have tried so far is, I have created a new sheet and with the help of query function I am storing this data into a different sheet, Is there a way to write a query function in a way, with the help of IF statements where it converts the data into numerical values.
The query I am using to fill the data in the next sheet.
=QUERY('Form responses 1'!A1:AF)
Is there a way where I can modify this query and get the result like this in the next sheet?
where value of "you slightly feel this way." should convert to 1
and value of "you somewhat feel this way (and somewhat not)." should convert to 2
or what is the other way to achieve the same result if not the queries?

merging worksheets/tabs within a google sheet

I am trying to merge 4 worksheets into an accumulative one, all columns are the same. But I still need to be able to add, manipulate and filter the data in all the different worksheets, including the accumulative one.
I have combined them using ={Armes!C3:AC25;Davis!A11:AC31;Riibe!A3:AC25;Winter!B3:AC24}; but cannot filter new worksheet.
Also tried: =QUERY({Armes!A3:AC25;Davis!A3:AC31;Riibe!A3:AC25;Winter!A3:AC24}) with same result
I still need to be able to add data and add filters
You'd get the best results by using the QUERY formula, just like the one in your example: =QUERY({Armes!A3:AC25;Davis!A3:AC31;Riibe!A3:AC25;Winter!A3:AC24}).
There are 2 ways you can filter your QUERY:
wrap the QUERY formula with FILTER formula and arguments:=FILTER(QUERY({Armes!A3:AC25;Davis!A3:AC31;Riibe!A3:AC25;Winter!A3:AC24}), condition1, [condition2, ...])
add the filtering into the QUERY itself:=QUERY({Armes!A3:AC25;Davis!A3:AC31;Riibe!A3:AC25;Winter!A3:AC24},"select * where condition1, [condition2, ...])
One thing you CAN NOT DO is to edit (you used the term "manipulate") the data in the query result table. You can only edit the QUERY formula itself, to filter and streamline the result according to your needs.

Reorganizing Google Sheets data dynamically

I'm currently working with Google Sheets to import data from Contact Form 7 in Wordpress. All the data is coming over fine, but I wanted to see about formatting it in more user friendly fashion. I've simplified the example a bit, but the gist of the form I have created allows the user to request multiple versions of a graphic file with different wording as needed, up to 5(my example has just 2 for simplicity sake).
All the data is imported using the CF7 variables and ideally I wanted to clean this up a bit. What I had thought of as a solution was creating a second sheet that pulls in this data submitted in the first sheet into a more user friendly format, as I intended to use this as a work form for a designer to create the requested graphic once the data is received. With each request the name/department/email/date all stay the same, but I'd like to display the version and line 1 and 2 data on another line. Is it possible to reorganize data like this on the fly, so when a new form is submitted and adds data to sheet 1, sheet 2 would then update with the properly formatted info?
Is this even possible to do? I did some looking online, but didn't anything that really related to this type of data manipulation.
Solution:
Here's what ended up working for my example
=ArrayFormula(QUERY({
Sheet1!A2:D,Sheet1!E2:G,ROW(Sheet1!A2:A);
IFERROR(LEN(Sheet1!A2:D)/0),Sheet1!H2:J,ROW(Sheet1!A2:A);
IFERROR(LEN(Sheet1!A2:D)/0),Sheet1!K2:M,ROW(Sheet1!A2:A);
IFERROR(LEN(Sheet1!A2:D)/0),Sheet1!N2:P,ROW(Sheet1!A2:A);
IFERROR(LEN(Sheet1!A2:D)/0),Sheet1!Q2:S,ROW(Sheet1!A2:A)
},"select Col1,Col2,Col3,Col4,Col5,Col6,Col7 where Col5<>'' order by Col8",1))
Yes, it's possible.
One way is to use arrays and the QUERY function.
For simplicity, let say that
Columns A and B have the general information of the order
Columns C and D have the data for version 1
Columns E and F have the data for version 2
Columns G and H have the data for version 3
On the output sheet, add the headers.
Below of them add a formula like the following:
=ArrayFormula(QUERY({A2:B,C2:D,ROW(A2:A);IFERROR(LEN(A2:B)/0),E2:F,ROW(A2:A);IFERROR(LEN(A2:B)/0),G2:H,ROW(A2:A)},"select Col1,Col2,Col3,Col4 where Col3<>'' order by Col5"))
References start on row 2 to skip the headers to avoid to include them on the output sheet.
ROW(A2:A) is used to keep the order
IFERROR(LEN(A2:B)/0) is a "trick" used to "hide" the order (general information) data for the second and following rows for the same order. On the select parameter of the QUERY function, it's referrey as Col5 on the order by clause.
It's assumed that lookup-choice-1 will never be empty.
NOTES:
If more columns were added, the column numbers should be updated accordingly
Don't use the order by clause to sort the result by the general information columns because the "trick" to hide the "labels". If you need to apply a sort, do it' before applying the above formula, you could do this by sorting the source range through the Data > Sort range... feature, so the data is sorted before it's transformed by the above formula.
See also
Sort and filter your data, an official help article describing Data > Sort range...

Resources