Why every data analyst needs the DuckDB GSheets plugin?

Why every data analyst needs the DuckDB GSheets plugin?

Machine-readable: Markdown · JSON API · Site index

Поделиться Telegram VK Бот
Транскрипт Скачать .md
Анализ с AI

Оглавление (1 сегментов)

Segment 1 (00:00 - 02:00)

I want to analyze this Google sheet with duck DB now I could just download each sheet as a CSV file or I could use the duck DB G sheets plugin and that's what we're going to do in this video so we'll install G sheets from the community so it's a community plugin and then we're going to load it create ourselves a secret of type G sheet that will then pop open our web browser we'll need to choose a Google account to log in and then it will redirect us to this page where it says authorization successful and we need to copy this token here this will be different each time that you run it so this code here is now invalid and then we're going to paste it into our duck DB terminal the next thing I'm going to do is copy the sheets URL to the clipboard and I'm going to put that in a variable and now we're going to write a query to describe it and we can use the read G sheet function and then pass in our variable and you can see it comes back so this is going to be the default sheet that was selected so it's the first one you see we've got content video title video publish time duration views and so on let's write a query against that sheet to find the video title The Views will get the number of days since the video was published and then we'll work out the number of views per day and we'll say it's going to be ones that have been around for about a month and you can see it comes back with the most popular videos that we've done on this channel you can also specify the sheet name so we can write another query and say I'm going to be looking at the totals sheet and then we can write some the views get the minimum minum views the day that happened the maximum views in and you can see it comes back so the best day was the 30th of January 2025 so it's about a month ago or so another cool thing that we can do if we come back to our Google sheet is we can write to it now if you're going to write to it you need to make sure the sheet that you want to write to exist so we're going to add ourselves a sheet we'll call it best day and then we'll come back to duck DB and we'll use the copy syntax and we'll say we're going to write another query it's going to get back this time from the chart data tab the video title the maximum views and then the day that happened and then we we'll group that order it by the maximum views write it to our sheet I can't use my variable here I guess that might be updated in a future version but at the moment you can't use it there so I just need to paste in my full uh Google Sheets URI format G sheet and then tell it which sheet you want to write to and you can see if we come back to the Google sheet it's now written it into there and so that's it we've managed to query the G sheet without having to download anything just pointing to beat straight to our Google sheet

Другие видео автора — Learn Data with Mark

Ctrl+V

Экстракт Знаний в Telegram

Экстракты и дистилляты из лучших YouTube-каналов — сразу после публикации.

Подписаться

Дайджест Экстрактов

Лучшие методички за неделю — каждый понедельник