<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Snowflake Data Share ERD in &amp;#128172 RevOps Discussions</title>
    <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Snowflake-Data-Share-ERD/m-p/898885#M2133</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/684050"&gt;@lanza_apollo&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Welcome to our community! I'd like to invite a few of our community members to the conversation — hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/10166"&gt;@johnelmer&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/513582"&gt;@Shadab_Khan&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/148101"&gt;@ChristinaKay&lt;/a&gt;, do&amp;nbsp;you have any experience with the type of question&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/684050"&gt;@lanza_apollo&lt;/a&gt;&amp;nbsp;is asking?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for taking a look! — Jaycee&lt;/P&gt;</description>
    <pubDate>Thu, 28 Dec 2023 22:57:49 GMT</pubDate>
    <dc:creator>Jaycee_Lewis</dc:creator>
    <dc:date>2023-12-28T22:57:49Z</dc:date>
    <item>
      <title>Snowflake Data Share ERD</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Snowflake-Data-Share-ERD/m-p/898513#M2132</link>
      <description>&lt;P&gt;I'm looking for some kind of ERD to help make sense of the relationships between the tables available to me in the Snowflake DataShare that is set up. Specifically trying to understand how to view email campaign performance.&amp;nbsp; I see within the various events_hs_scheduled_email_v2 and other events_ email tables there is a property_hs_email_campaign_id field. Ideally I would like to view deliveries, opens, etc. on a campaign basis.&amp;nbsp; Unfortunately I cannot figure out how to tie this to any of the campaign tables that I think it could be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with campaign_ids as (
select
distinct property_hs_email_campaign_id as campaign_id
from crm_platform_data_from_hubspot.v2_daily.events_opened_email_v2
order by 1 asc

)

, associations as (
select
*
from crm_platform_data_from_hubspot.v2_daily.associations
)

select
*
from associations
inner join campaign_ids
on associations.toobjectid::varchar = campaign_ids.campaign_id::varchar
limit 100&lt;/LI-CODE&gt;&lt;P&gt;The sample sql code should return any association that I can join the property_hs_email_campaign_id to.&amp;nbsp; Am I missing some kind of mapping table? Ultimately I'm trying to go from objects_campaigns -&amp;gt;emails_delivered, emails_opened, etc.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2023 22:37:06 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Snowflake-Data-Share-ERD/m-p/898513#M2132</guid>
      <dc:creator>lanza_apollo</dc:creator>
      <dc:date>2023-12-27T22:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Snowflake Data Share ERD</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Snowflake-Data-Share-ERD/m-p/898885#M2133</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/684050"&gt;@lanza_apollo&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Welcome to our community! I'd like to invite a few of our community members to the conversation — hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/10166"&gt;@johnelmer&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/513582"&gt;@Shadab_Khan&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/148101"&gt;@ChristinaKay&lt;/a&gt;, do&amp;nbsp;you have any experience with the type of question&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/684050"&gt;@lanza_apollo&lt;/a&gt;&amp;nbsp;is asking?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for taking a look! — Jaycee&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 22:57:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Snowflake-Data-Share-ERD/m-p/898885#M2133</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2023-12-28T22:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Snowflake Data Share ERD</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Snowflake-Data-Share-ERD/m-p/899696#M2135</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074"&gt;@Jaycee_Lewis&lt;/a&gt;&amp;nbsp;thank you for passing this along. To further elaborate, I'm really looking for any documentation/direction on how to associate emails delivered, opened, etc. with campaigns. An ERD would be great but really any documentation will do, especially sample SQL code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2024 15:02:12 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Snowflake-Data-Share-ERD/m-p/899696#M2135</guid>
      <dc:creator>lanza_apollo</dc:creator>
      <dc:date>2024-01-02T15:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Snowflake Data Share ERD</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Snowflake-Data-Share-ERD/m-p/899949#M2137</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/684050"&gt;@lanza_apollo&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Rob A. from HubSpot's Solution Architecture team here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a great question. It definitely takes some data exploration and knowledge of how HubSpot structures data to answer your query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To my knowledge there is not a full ERD published that visualizes every relationship of data made available in the Snowflake data share. However, here are a few tips:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;If you haven't already seen it, &lt;A href="https://knowledge.hubspot.com/reports/query-hubspot-data-in-snowflake#object-and-event-type-queries" target="_blank" rel="noopener"&gt;this is the best piece of documentation that shows how to make many types of queries&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;The Snowflake Data Share is essentially a replication of data that powers the HubSpot Custom Report Builder. As such, you can use the Report Builder to understand what data likely relates to other data. The UI shows what data can be related to other data. Additionally, there's a section that shows how the data join query will return records&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="robertainslie_0-1704254515320.png" style="width: 388px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/106285i111E35C060DAE22B/image-dimensions/388x539?v=v2" width="388" height="539" role="button" title="robertainslie_0-1704254515320.png" alt="robertainslie_0-1704254515320.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="robertainslie_1-1704254561878.png" style="width: 525px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/106286iAFBABA1857B94648/image-dimensions/525x476?v=v2" width="525" height="476" role="button" title="robertainslie_1-1704254561878.png" alt="robertainslie_1-1704254561878.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;For your specific question, you likely are interested in data from Marketing Emails, Marketing Email Events, and Campaigns (you may also be interested in joining to Contacts object if you want to know which Contacts opened the email).&lt;/LI&gt;
&lt;LI&gt;I dug into this query, and I haven't done the aggregations, but I think this query will get you close to what you want (the tables are aliased to my portal, so you'll have to alter the table and view names). I think you will need to group by the Campaign Names and aggregate count by the unique email events&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;select HUB_203693_DB.V2_DAILY.OBJECTS_MARKETING_EMAILS.OBJECTID as "Marketing Email ID",
HUB_203693_DB.V2_DAILY.OBJECTS_MARKETING_EMAILS.PROPERTY_HS_NAME as "Internal Name of Marketing Email",
HUB_203693_DB.V2_DAILY.OBJECTS_MARKETING_EMAILS.PROPERTY_HS_ORIGIN_ASSET_ID as "Content ID of Marketing Email",
HUB_203693_DB.V2_DAILY.OBJECTS_MARKETING_EMAILS.PROPERTY_HS_CAMPAIGN_NAME as "Internal ID of Campaign Associated to Marketing Email",
HUB_203693_DB.V2_DAILY.EVENTS_OPENED_EMAIL_V2.ID as "Email Open Event ID",
HUB_203693_DB.V2_DAILY.OBJECT_WITH_OBJECT_PROPERTIES.PROPERTIES['hs_origin_asset_id'] as "HubSpot Campaign ID",
HUB_203693_DB.V2_DAILY.OBJECT_WITH_OBJECT_PROPERTIES.PROPERTIES['hs_name'] as "HubSpot Campaign Name"

from HUB_203693_DB.V2_DAILY.OBJECTS_MARKETING_EMAILS
join HUB_203693_DB.V2_DAILY.EVENTS_OPENED_EMAIL_V2 
ON HUB_203693_DB.V2_DAILY.OBJECTS_MARKETING_EMAILS.PROPERTY_HS_ORIGIN_ASSET_ID = HUB_203693_DB.V2_DAILY.EVENTS_OPENED_EMAIL_V2.PROPERTY_HS_EMAIL_META_CONTENT_ID
join HUB_203693_DB.V2_DAILY.OBJECT_WITH_OBJECT_PROPERTIES 
ON HUB_203693_DB.V2_DAILY.OBJECTS_MARKETING_EMAILS.PROPERTY_HS_CAMPAIGN_NAME = 
TO_VARCHAR(HUB_203693_DB.V2_DAILY.OBJECT_WITH_OBJECT_PROPERTIES.PROPERTIES['hs_origin_asset_id']) &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I think the most important things to highlight:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The Object Ids of Campaigns and Marketing Emails are different from the 'content' or 'asset' IDs that are actually used by the HubSpot product (there's some legacy software reasons for this)&lt;/LI&gt;
&lt;LI&gt;Both the Campaign and Open/Click email events use these alternative IDs for their joins NOT the object IDs of those records (you can see this in the SQL I shared)&lt;/LI&gt;
&lt;LI&gt;The Content ID of the Marketing Email is what you would add to a HubSpot URL to actually see the email in reference:&amp;nbsp;&lt;A href="https://app.hubspot.com/email/{{Hub" target="_blank" rel="noopener"&gt;https://app.hubspot.com/email/{Hub&lt;/A&gt;&amp;nbsp;ID}/details/{Email content ID}/performance&lt;/LI&gt;
&lt;LI&gt;The Campaign object data provides a nested JSON object with details about the campaign, which I had to extract into separate columns to get the HubSpot Campaign ID&lt;/LI&gt;
&lt;LI&gt;Also very&amp;nbsp; critical to know: when you're working with the email event data (Opens, Clicks, etc), there is a column that is called "&lt;SPAN&gt;PROPERTY_HS_EMAIL_CAMPAIGN_ID" - this is a DIFFERENT "campaign ID" to the campaign ID we are referencing above. One of these is an ID used to track unique instances of sending an email (for things like A/B sends, Batch sends, Automated sends) and the other is what you see when you navigate to the "Campaigns" tool in HubSpot. &lt;/SPAN&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="robertainslie_2-1704255612309.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/106287iCC68984E53D3CD0A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="robertainslie_2-1704255612309.png" alt="robertainslie_2-1704255612309.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Here's another helpful query: showing pulling the Campaign data. The "OBJECTTYPEID" can be used to only query data about the Campaign&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;select *, HUB_203693_DB.V2_DAILY.OBJECT_WITH_OBJECT_PROPERTIES.PROPERTIES['hs_origin_asset_id'] 
from HUB_203693_DB.V2_DAILY.OBJECT_WITH_OBJECT_PROPERTIES where OBJECTTYPEID = '0-35'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this is helpful - let me know how you get on with this!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 04:31:12 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Snowflake-Data-Share-ERD/m-p/899949#M2137</guid>
      <dc:creator>robertainslie</dc:creator>
      <dc:date>2024-01-03T04:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Snowflake Data Share ERD</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Snowflake-Data-Share-ERD/m-p/900329#M2144</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/1226"&gt;@robertainslie&lt;/a&gt;&amp;nbsp;. After playing with this I was able to answer my inital question and more. While not entirely intuitive, the relationships make sense to me and this unblocks me for now. Have a great week&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 18:37:32 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Snowflake-Data-Share-ERD/m-p/900329#M2144</guid>
      <dc:creator>lanza_apollo</dc:creator>
      <dc:date>2024-01-03T18:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Snowflake Data Share ERD</title>
      <link>https://community.hubspot.com/t5/128172-RevOps-Discussions/Snowflake-Data-Share-ERD/m-p/1203949#M3474</link>
      <description>&lt;P data-unlink="true"&gt;hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/684050"&gt;@lanza_apollo&lt;/a&gt;&amp;nbsp;Sorry this is a bit late but you might want to check out&amp;nbsp;Secoda&amp;nbsp;if you're still running into issues. It'll automatically generate an ERD across Snowflake and the rest of your data stack. It will also let you chat with your data in natural language.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Sep 2025 15:29:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/128172-RevOps-Discussions/Snowflake-Data-Share-ERD/m-p/1203949#M3474</guid>
      <dc:creator>tuttopanino</dc:creator>
      <dc:date>2025-09-23T15:29:28Z</dc:date>
    </item>
  </channel>
</rss>

