JavaScript Filter Method Tutorial - Google Sheets Apps Scripts - Array Methods Part 7

  Рет қаралды 72,209

Learn Google Sheets & Excel Spreadsheets

Learn Google Sheets & Excel Spreadsheets

Күн бұрын

Пікірлер: 81
@eyemoksha
@eyemoksha 2 жыл бұрын
You are a Perfect Teacher. You have taught me a lot. THANK YOU for all your lessons.
@jmcanally3
@jmcanally3 5 жыл бұрын
Thank you. This technique just saved me hours, days, months of frustration. Love the videos.
@rashidanwar7831
@rashidanwar7831 5 жыл бұрын
You are really doing a great job. Thumbs up for your efforts and easy to understand teaching style. Thanks a lot.
@plinioglad
@plinioglad Жыл бұрын
Very good!!!!! Congratulations!!!
@kafkareader3212
@kafkareader3212 5 жыл бұрын
Thanx a lot, man. You give a lot of good information to up GS skills. I am from Russia and here i cant find a lot of answeres for my questions. You help a lot. Keep going and good luck. :)
@lowernorth9972
@lowernorth9972 5 жыл бұрын
This would be great if it returned filtered items from a data validation drop down within the spreadsheet. Dig the videos, keep it up. Love the typos too XD
@TinaFO-tc2dd
@TinaFO-tc2dd 5 ай бұрын
Thank you for this video! I would like to know if there is a way of filtering by "value" and "background color". Thank you again!
@Ro0Dr1Gg0
@Ro0Dr1Gg0 4 жыл бұрын
Amazing!!! Thanks for share!!
@yrin84
@yrin84 4 жыл бұрын
your videos are the best on this field!
@ExcelGoogleSheets
@ExcelGoogleSheets 4 жыл бұрын
Glad you like them!
@jarabialex
@jarabialex 3 жыл бұрын
Awesome! Awesome! Awesome!
@bruno_snitram
@bruno_snitram 2 жыл бұрын
Awesome. Thank you for sharing.
@Barrel4336
@Barrel4336 4 жыл бұрын
This was good overview on filters for Apps Script, following your methods I was able to get a filter function to work, but I was not able to get the function to filter based on a specific date. This returns me an empty array and I was wondering if you had any advice for using the filter function for a dataset that has dates associated with it?
@daytodatainc.2520
@daytodatainc.2520 3 жыл бұрын
Great video, simplistic examples so it all makes sense!
@danieldotimas1786
@danieldotimas1786 3 жыл бұрын
Thank you for this. May I ask how to Reset all existing filters in a sheet using script?
@siocgsd7894
@siocgsd7894 3 жыл бұрын
Hello. I would like to know if this is, like, automated? Like when you add data it will be added on the filtered data on the tab that your appscript created. Or do you need to click run again?
@MuriloMBarquette
@MuriloMBarquette Жыл бұрын
Fantastic!
@joycekosak
@joycekosak 3 жыл бұрын
This is awesome, gave me exactly what I needed to know to get the data filtered. I also want to update the column next to my original data indicated that I have copied those rows that met the filter conditions. Any thoughts on how to do that? I filter and copy the data to another sheet, and I want the original sheet to now indicate "Submitted" to the lines that were copied over.
@edwinalansilvatorres544
@edwinalansilvatorres544 2 жыл бұрын
Awesome 😃 Thanks!
@carmencastro5512
@carmencastro5512 6 жыл бұрын
Here I found what I was looking for, thank you so much for sharing ......
@lauramcooley
@lauramcooley 2 жыл бұрын
I feel like a fog has been lifted. Thank you!!
@mikemccartneyable
@mikemccartneyable 6 жыл бұрын
Absolutely super channel and content.
@TheOrteme
@TheOrteme 3 жыл бұрын
MAN YOU DOING GREAT THING THANK YOU!
@michaeltimpano1278
@michaeltimpano1278 4 жыл бұрын
Great videos! Very helpful. How would you use filter or map to search the first row columns headings for a key word and then return all the rows that are in that column? I can pull all the rows with a filtered word, but not if the search is restricted to the first row. Any ideas? Thanks.
@profleomartinez1551
@profleomartinez1551 3 жыл бұрын
Hi, excellent! I implement it in reading my students' spreadsheet. I separate one class from another and define it in a cell. Thank you!!
@home2office515
@home2office515 3 жыл бұрын
Nice video
@leorraedvalmonte
@leorraedvalmonte 3 жыл бұрын
How do use multiple criteria but for each criterion that is blank have it disregard the data and filter only based on criteria that is non blank?
@jasonmagee5988
@jasonmagee5988 3 жыл бұрын
Is there a way to place the results on an html form similar to your instructions for the search in a crud?
@syscomseatings8964
@syscomseatings8964 4 жыл бұрын
This is great tutorial .. IS there a way where we can have one single function which will take multiple search as array and corresponding columns in which to search as an other array and search ie i want to search for "yes" in col3 , completed in col4 , >50 in col5 , I might not have all these 3 everytime... so how do i have a generic function which will run as per length of the search item/column arrays. Hope I am making sense :(
@iArthurTou
@iArthurTou 5 жыл бұрын
Can this filter method can filter date between or filter date by criteria bigger than day , less than date ? How can do it . Thanks !
@dme3327
@dme3327 4 жыл бұрын
HI, Could you please let me know how can i copy data with hyperlink format suppose i have data in which some cells have hyperlink and if copy data and paste it another sheet then hyperlink format should be same, is there any way to do this activity please do let me know
@ajayshakti5818
@ajayshakti5818 4 жыл бұрын
Thanks ..
@arielzabatecuizon5147
@arielzabatecuizon5147 3 жыл бұрын
Hi, how can I filter using partial string?, like I want to return all contains "tex".
@adolfoenriquelobos8117
@adolfoenriquelobos8117 4 жыл бұрын
Excellent video!! It helps me to solve searches efficiently. My query is the following, How can I get the row in which the entered value was found? Thank you!
@tonypeterson3477
@tonypeterson3477 5 жыл бұрын
Thanks for this filter video guide. It is very useful. May I please know the scripts for the sale rep who are not "Jerry Jefferson"? I would greatly appreciate it if you could help me with this matter. Tony
@pichit.raetai
@pichit.raetai 5 жыл бұрын
Wow.. thank you very much
@garychadwick1240
@garychadwick1240 4 жыл бұрын
Once again, thanks for another excellent tutorial. One question though. I’ve noticed that sometimes you use == and sometimes === in your formula. What’s the difference?
@ExcelGoogleSheets
@ExcelGoogleSheets 4 жыл бұрын
On a basic level: == checks for value only === checks for value and type example: 4 === "4" IS NOT TRUE, because one is a number, the other is text. So the type is not the same. 4 == "4" IS TRUE, because == doesn't check the type.
@garychadwick1240
@garychadwick1240 4 жыл бұрын
Learn Google Spreadsheets Makes perfect sense. Thanks for your fast response! 👌🏻
@shaitaan0666
@shaitaan0666 Жыл бұрын
how to filter between two dates match with it data
@128MrAndy
@128MrAndy 2 жыл бұрын
Thanks!
@ExcelGoogleSheets
@ExcelGoogleSheets 2 жыл бұрын
I appreciate it!
@KhalilYasser
@KhalilYasser 6 жыл бұрын
Thank you very much. As for the link of the sheet, when trying to navigate to script editor, it doesn't appear. Can you share the code?
@KhalilYasser
@KhalilYasser 6 жыл бұрын
Here's the code used the video. Hope this helps others pastebin.com/k9sC42Lq
@andreaguerri.educational
@andreaguerri.educational 3 жыл бұрын
Hi, thanks...but I have a problem with between date array. For example: in my spreadsheets I have a colum with date, it's work currently with getMonth, getFullYear, but not working with between date. This is a code: var sheet = SpreadsheetApp.getActive(); var ss = sheet.getSheetByName("Fatturato"); var data = ss.getRange(4, 4, ss.getLastRow(), 4).getValues(); var startDate = new Date("2017-01-01"); var endDate = new Date("2022-01-01"); var result = data.filter(function(row){ var d = new Date( row[0] ); return d.setDate() >= startDate && d.getDate
@ruchikabadesra5888
@ruchikabadesra5888 3 жыл бұрын
Hi. I used the same method to filter data and the same method to create a new sheet and paste data using setvalues(). But it is throwing an error - TypeError: Cannot read property 'length' of undefined. I checked that the filtered data is not empty. On logging out the length, it is giving numeric values. Can you please help?
@ExcelGoogleSheets
@ExcelGoogleSheets 3 жыл бұрын
Check your spelling, everything is case sensitive.
@giorgionatale7190
@giorgionatale7190 3 жыл бұрын
Nice video man, but just a question . How can you filter de color of The cell?
@ExcelGoogleSheets
@ExcelGoogleSheets 3 жыл бұрын
is you use getRange().getBackgrounds() instead of getRange().getValues() it will give you an array of colors in hex format.
@irfankalkar8461
@irfankalkar8461 Жыл бұрын
​@@ExcelGoogleSheets I have already tried it, but this time we can't get the values of relevant rows as one column or as all columns which were filtered by color. Because, (firstly thanks for your video but) your video doesn't explain how to get Values of a row together with all columns if that row has relevant color which was expected to be found by filter. Also i want to make this filter as normal filter in same sheet by hiding the rows in which relevant value or background color are not found after filter query. Can you help me on this topic ?
@jihenothmen3275
@jihenothmen3275 3 жыл бұрын
Hi thanks for this tutorial, when i insert a sheet i get an error message "ReferenceError: tab is not defined"
@ravisingh2234
@ravisingh2234 4 жыл бұрын
it's showing error like : TypeError: Cannot read property 'length' of undefined (line 12, file "Test")
@ChallaRamakrishnaDynamicsAX
@ChallaRamakrishnaDynamicsAX 5 жыл бұрын
Just amazing!!
@paulloup5210
@paulloup5210 6 жыл бұрын
Thank you very much !!!
@tomas_thephotographer
@tomas_thephotographer 4 жыл бұрын
@Learn Google Spreadsheets, if I would like to at the end show in new sheet only 1 column and 7 column, how can I do it?
@ExcelGoogleSheets
@ExcelGoogleSheets 4 жыл бұрын
Use .map method kzbin.info/www/bejne/jXKbgqKqg6qJmZY
@thiagodecastroartiga8893
@thiagodecastroartiga8893 3 жыл бұрын
Man thanks again!!
@EnnaNadanthaalum
@EnnaNadanthaalum 2 жыл бұрын
TypeError: Cannot read property '1' of undefined pls help
@phoenixempire8886
@phoenixempire8886 4 жыл бұрын
🙏🏻
@ConsulthinkProgrammer
@ConsulthinkProgrammer 3 жыл бұрын
Sir, suppose I have script like this: var leaveFilter = data.filter(data => {return data[1 == "Annual Leave" || data[1] == "Vacation leave" || data[1] == "Sick" || data[1] == "Important leave"}); How if I want make some iteration, or loop perhaps, so I just have to make that filter in array like this: filters = [ "Annual Leave", "Vacation leave", "Sick", "Important leave"] Which later I want that I could use that filters variable to do some iteration/loop in filter method above. Could you help to break this problem?
@ExcelGoogleSheets
@ExcelGoogleSheets 3 жыл бұрын
var leaveFilter = data.filter(data => {return [ "Annual Leave", "Vacation leave", "Sick", "Important leave"].includes(data[1])});
@ConsulthinkProgrammer
@ConsulthinkProgrammer 3 жыл бұрын
@@ExcelGoogleSheets Thanks a lot Sir. Perfectly works :D
@luisgermanorregocampano1987
@luisgermanorregocampano1987 2 жыл бұрын
Impressive! Thank you very much for this tutorial. Do you still have your patreon?
@ExcelGoogleSheets
@ExcelGoogleSheets 2 жыл бұрын
Thank You! Yes www.patreon.com/chicagocomputerclasses
@ConsulthinkProgrammer
@ConsulthinkProgrammer 3 жыл бұрын
How if we want to filter by date which is first column in the video, Sir? I've tried something like this: var date1 = new Date("2/15/2017"); var dateFilter = values.filter(function(r) { return r[0] == date1; }); But it didn't work and I just got an empty [] How we could do that correctly Sir?
@ExcelGoogleSheets
@ExcelGoogleSheets 3 жыл бұрын
var dateFilter = values.filter(function(r) { return r[0].getTime() == date1.getTime(); });
@ExcelGoogleSheets
@ExcelGoogleSheets 3 жыл бұрын
Be careful with time zones when you do this.
@ConsulthinkProgrammer
@ConsulthinkProgrammer 3 жыл бұрын
@@ExcelGoogleSheets Thanks for your feedback and code Sir. I did a little bit of modification, then changed my time zone setting, considering your advice.. And, great, it works. Again, thanks a lot Sir :)
@NishantKumar-tc5ej
@NishantKumar-tc5ej 2 жыл бұрын
This method is removing the header. It is possible to retain it?
@ExcelGoogleSheets
@ExcelGoogleSheets 2 жыл бұрын
let headers = data.shift() data = data.filter(logic) data.unshift(headers)
@jdee603
@jdee603 3 жыл бұрын
I followed the advice in the video but I keep getting an error message TypeError: originalData.filter is not a function (line 8, file "Code") function myFunction() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var trn = ss.getSheetByName("Transactions"); var originalData = trn.getRange(2, 1, trn.getLastRow()-1,7).getValues; var salesRep = "Jerry Jefferson"; var data = originalData.filter(function(item){ return item[1] === salesRep && item[4] > 300; }); var targetSheet = ss.insertSheet(salesRep); targetSheet.getRange(2, 1, data.length, data[0].length).setValues(data); } Any help?
@sushilkumarthakur6033
@sushilkumarthakur6033 3 жыл бұрын
#Deliting row based on condition or when the condition met and copying deleted row in another sheet. &How to get a particular array when the condition met (filter method doesn't go well as it returns a whole array of rows) Can anyone help me out with any inputs and video links? It will be appreciated.
@dustinelliott-br2l359
@dustinelliott-br2l359 5 жыл бұрын
Thank you. This is almost exactly what I am looking for, but I do not understand why I am receiving this error - TypeError: Cannot find function filter in object [object Array].- on this line: var data = originalData.filter(function(item){ return item[1] === salesRep && item[4] > 300; });
@ExcelGoogleSheets
@ExcelGoogleSheets 5 жыл бұрын
your error happens before that line.
@dustinelliott-br2l359
@dustinelliott-br2l359 5 жыл бұрын
I tried again and it worked. I do not know why it did not work the first time. Thanks again. Very helpful videos.
@dustinelliott-br2l359
@dustinelliott-br2l359 5 жыл бұрын
@@ExcelGoogleSheets If I had a dozen sales amounts that I wanted to filter on, and those amounts were in Col J of Transactions (rows 2-13), instead of writing several ||/or statements, is there a way I could incorporate indexOf into the filter function? That way, if the amounts in Col J changed, I would not need to modify the script. I saw something about indexOf > -1 online, but I cannot apply it correctly to this example. Thank you.
@ลิขิตชัยกิจ
@ลิขิตชัยกิจ 3 жыл бұрын
It shown TypeError: originalData.filter is not a function (line 7, file "filter") /which is var data = originalData.filter(function(item){ return item[1] === "BA"; });
@ExcelGoogleSheets
@ExcelGoogleSheets 3 жыл бұрын
That means check the line var originalData = blah blah;
@bdawg7132
@bdawg7132 5 жыл бұрын
Wish it worked for me.
@66Komodo
@66Komodo 5 жыл бұрын
👍🏻
JavaScript Arrays Sort Method Tutorial - Google Sheets Apps Scripts - Array Methods Part 9
42:07
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 24 М.
How to Get The Last Row - Google Sheets Apps Scripts - Array Methods Part 10
24:34
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 64 М.
ТЮРЕМЩИК В БОКСЕ! #shorts
00:58
HARD_MMA
Рет қаралды 1,5 МЛН
Amazing remote control#devil  #lilith #funny #shorts
00:30
Devil Lilith
Рет қаралды 15 МЛН
JavaScript indexOf, lastIndexOf Methods Tutorial - Google Sheets Apps Scripts - Array Methods Part 6
20:31
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 32 М.
Google Sheets - Filter Function Tutorial, Introduction to Logical Arrays
32:04
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 132 М.
JavaScript Arrays - Programming Like a Grown Up - Google Sheets Apps Scripts - Array Methods Part 5
20:32
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 57 М.
Google Sheets - Add Timestamp When Cell Changes - Apps Script
16:39
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 340 М.
Find Data Using Headers in Google Sheets - Apps Script JavaScript
8:29
8 Must Know JavaScript Array Methods
10:05
Web Dev Simplified
Рет қаралды 1 МЛН
Sort Data in Google Sheets using Google Apps Script
9:18
Yagisanatode -Scott-
Рет қаралды 8 М.
JavaScript Arrays & Map Method Tutorial - Google Apps Script Part 4
26:53
Learn Google Sheets & Excel Spreadsheets
Рет қаралды 55 М.