Dynamic Pivot Columns | How to generate dynamic Pivot Columns in BigQuery

  Рет қаралды 9,296

Datasudh

Datasudh

Күн бұрын

SQL Code available at : datasudh.com/b...

Пікірлер: 15
@shivarajmiraje6672
@shivarajmiraje6672 10 күн бұрын
Really helpful 🎉
@agustinnosiglia5848
@agustinnosiglia5848 2 жыл бұрын
Exactly what I was looking for with an easy-to-understand example! Thanks!
Жыл бұрын
Awesome! Congrats for the videos! Keep posting to the BigQuery series please!!! Cheers
@yuejian8089
@yuejian8089 2 жыл бұрын
Thank you!!!! It reallly helps a lot.
@TechnologiesExtendo
@TechnologiesExtendo Жыл бұрын
Thank you much for the tutorial! Just what I need it. Now, how can you create an new table from the results in a way you can do it scheduled? I believe that would be using STORE PROCEDUREs with this scripting, but I don't know what would be the syntax to store the results into a final TABLE that can be reconstructed every time I run the PROCEDURE. I tried using SCHEDULED QUERIES but the scripting is not allowed there. Any help would be much appreciated.
@user-vy1py7io7s
@user-vy1py7io7s Жыл бұрын
Great Video!
@hasanasim3980
@hasanasim3980 2 жыл бұрын
Thank you for the wonderful explanation. Is there a similar way by which we can dynamically aggregate string columns in bigquery sql? Usually we would just use Select STRING_AGG(col_1), col_2 From table1 Group BY col_2. What if the number of columns are increasing dynamically?
@datasudh
@datasudh 2 жыл бұрын
Hi Hasan, if you have a scenario where in you want to keep creating aggregate values for dynamic columns which can exist at any point of time then basically you need a query which adds that column formula at run time. You can achieve that by using combination of metadata table which will tell about new column and then add the same to dynamic SQL with string agg function. Do you have a use case where in your columns are increasing dynamically ?
@hasanasim3980
@hasanasim3980 2 жыл бұрын
@@datasudh I have a ‘contacts’ table in which new columns (containing information about the contacts like their age etc.) are being added everyday. These columns have either nulls or string values. I want to string aggregate all these columns and group by contact id so that I get one unique row per contact ID.
@hasanasim3980
@hasanasim3980 2 жыл бұрын
@@datasudh thanks for your reply. I have been trying to use INFORMATION_SCHEMA.COLUMNS with dynamic sql to solve this problem but have been unsuccessful so far.
@datasudh
@datasudh 2 жыл бұрын
@@hasanasim3980 ok, I will give this a try this week and share results with a blog
@alelust7170
@alelust7170 2 жыл бұрын
Tks a lot!
@ClaudioDeLucke
@ClaudioDeLucke Жыл бұрын
How could i connect this to sheets?
@lxvi4322
@lxvi4322 Жыл бұрын
Thansk, can I use this with a CTE?
Dynamic Pivot function in sql server | sql dynamic pivot data
15:12
Training2SQL MSBI
Рет қаралды 10 М.
SQL Query | How to dynamically convert rows into columns | Dynamic Pivot
16:18
My daughter is creative when it comes to eating food #funny #comedy #cute #baby#smart girl
00:17
Pivot Tables in BigQuery SQL🤓
8:30
Mr. Rohbot
Рет қаралды 4 М.
Understanding BigQuery data governance
8:35
Google Cloud Tech
Рет қаралды 25 М.
Create a Dynamic Pivot Stored Procedure in Snowflake
20:59
Pivot Operator BigQuery
8:52
Code Sadhana
Рет қаралды 1 М.
SQL Tutorial - PIVOT
13:11
BeardedDev
Рет қаралды 127 М.
Loops in BigQuery: Recursive Joins
9:33
Mr. Rohbot
Рет қаралды 3,2 М.
Solving SQL Query | Rows to Column in SQL
1:13:11
techTFQ
Рет қаралды 170 М.