This is great!! I have much to learn 😅. I was able to follow clearly and end up with exactly what I need. I need to join this output table to another few tables, though, and be able to reference it later. How do you get this result set table created as a real table? Stick a “CREATE OR REPLACE TABLE AS” somewhere?
@dotpi5907 Жыл бұрын
Great, that's really good to hear. A few people have asked about that, and it doesn't seem so straight forward. I'll look into what the best ways of doing that are and make that the next video. Thanks for the suggestions!
@dotpi5907 Жыл бұрын
Hi @jessicalenoir9979, I have an answer for you now. This was my mistake that it was difficult to put into a select statement, because I made the pibot into a 'stored procedure' rather than a 'user-defined function', see the difference here docs.snowflake.com/en/developer-guide/stored-procedures-vs-udfs. To define the dynamic pivot as a user-defined function you would use: create or replace function dynamic_pivot(... You could then select the result from the user-defined function using: select dynamic_pivot(...) Hopefully that helps, let me know if that works for you.