-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Mode queries #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small stuff, all formatting! Take care of this stuff and it's totally ready to merge.
mode_queries/parameters.sql
Outdated
@@ -0,0 +1,18 @@ | |||
select 1 | |||
|
|||
{% form %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you put this form section into audience_overview.sql
? we might want to add other queries in the future that could potentially have different parameters.
mode_queries/audience_overview.sql
Outdated
sum(case when session_number = 1 then 1 else 0 end) as new_sessions, | ||
sum(case when session_number > 1 then 1 else 0 end) as repeat_sessions | ||
|
||
from dbt_claire.segment_web_sessions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use ref()
in the analysis section as well!
mode_queries/audience_overview.sql
Outdated
@@ -0,0 +1,15 @@ | |||
select |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file should be located in analysis/
:) you probably haven't used that folder much! it's an oft-overlooked feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually thought about that, but then figured because there was the form
liquid tag, it would break. I'll just wrap the form
tag in a raw
tag 👍
mode_queries/audience_overview.sql
Outdated
sum(case when session_number = 1 then 1 else 0 end) as new_sessions, | ||
sum(case when session_number > 1 then 1 else 0 end) as repeat_sessions | ||
|
||
from dbt_claire.segment_web_sessions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we still use the same SQL style guide for queries we write in mode. So--indentation, wrapping everything in CTEs, having an "import" CTE at the top (with sessions as...
)
@@ -0,0 +1,56 @@ | |||
{#- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drewbanin had a look at this with me, and he also couldn't get it to work.
dbt-labs/dbt-core#1152
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok--maybe put this in a markdown file then? that way it won't attempt to be compiled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to keep it as the sql comment
@clrcrl hey! we should get this merged. I think these comments are all handled, right? |
No description provided.