<?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 use a query with the bigquery connector in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/use-a-query-with-the-bigquery-connector/m-p/2430831#M20197</link>
    <description>&lt;P&gt;I have this query that I want to use with the bigquery connector.&amp;nbsp; It looks like with the base functionality, you just pick tables and it pull the tables in.&amp;nbsp; I would like to run this query and pull the results back.&amp;nbsp; Can I do that with the bigquery connector?&lt;/P&gt;
&lt;P&gt;with prep as (&lt;BR /&gt;select&lt;BR /&gt;user_pseudo_id,&lt;BR /&gt;(select value.int_value from unnest(event_params) where key = 'ga_session_id') as session_id,&lt;BR /&gt;array_agg((select value.string_value from unnest(event_params) where key = 'source') ignore nulls order by event_timestamp)[safe_offset(0)] as source,&lt;BR /&gt;array_agg((select value.string_value from unnest(event_params) where key = 'medium') ignore nulls order by event_timestamp)[safe_offset(0)] as medium,&lt;BR /&gt;array_agg((select value.string_value from unnest(event_params) where key = 'campaign') ignore nulls order by event_timestamp)[safe_offset(0)] as campaign,&lt;BR /&gt;max((select value.string_value from unnest(event_params) where key = 'gclid')) as gclid,&lt;BR /&gt;countif(event_name = 'lead_completed') as lead_completed_count,&lt;BR /&gt;countif(event_name = 'phone_link_click') as phone_link_click_count,&lt;BR /&gt;countif(event_name = 'osc_chat_started') as osc_chat_started_count,&lt;BR /&gt;countif(event_name = 'osc_text_requested') as osc_text_requested_count,&lt;BR /&gt;countif(event_name = 'scheduled_appointment') as scheduled_appointment_count,&lt;BR /&gt;countif(event_name = 'virtual_scheduled_appointment') as virtual_scheduled_appointment_count&lt;BR /&gt;from&lt;BR /&gt;`ga4-tb-data.analytics_270728985.events_20240304`&lt;BR /&gt;group by&lt;BR /&gt;user_pseudo_id,&lt;BR /&gt;session_id&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;select&lt;BR /&gt;-- session default channel grouping (dimension | the channel group associated with a session) &lt;BR /&gt;case &lt;BR /&gt;when source = '(direct)' and (medium in ('(not set)','(none)')) then 'Direct'&lt;BR /&gt;when gclid is not null then 'Paid Search' -- Categorizing as Paid Search when gclid is not null&lt;BR /&gt;when regexp_contains(source,'Facebook|Instagram|Linkedin|Pinterest|Tiktok|Twitter|X')&lt;BR /&gt;and regexp_contains(medium,'Social') then 'Paid Social'&lt;BR /&gt;when regexp_contains(medium,'Display|DisplayNGDN|Display_NGDN') then 'Display'&lt;BR /&gt;when regexp_contains(source,'facebook|instagram|linkedin|pinterest|tiktok|twitter|whatsapp|linkin.bio')&lt;BR /&gt;or medium = 'Social' then 'Organic Social'&lt;BR /&gt;when regexp_contains(source,'baidu|bing|duckduckgo|ecosia|google|yahoo')&lt;BR /&gt;or medium = 'organic' then 'Organic Search'&lt;BR /&gt;when source = 'Tbmail' then 'Email'&lt;BR /&gt;when regexp_contains(source,'(newhomesource|realtor|trulia|zillow|livabl|redfin|newhomesourceprofessional|casasneuvasaqui|homes)') then 'Affiliates'&lt;BR /&gt;when medium = 'referral' then 'Referral'&lt;BR /&gt;when regexp_contains(source, 'yext|Yext') then 'Location Listings'&lt;BR /&gt;when regexp_contains(medium,'Offline Media|Print|Direct Mail|TBQR') then 'Offline Media'&lt;BR /&gt;else 'Unassigned' end as channel_grouping_session,&lt;BR /&gt;count(distinct concat(user_pseudo_id,session_id)) as sessions,&lt;BR /&gt;sum(lead_completed_count) as lead_completed,&lt;BR /&gt;sum(phone_link_click_count) as phone_link_click,&lt;BR /&gt;sum(osc_chat_started_count) as osc_chat_started,&lt;BR /&gt;sum(osc_text_requested_count) as osc_text_requested,&lt;BR /&gt;sum(scheduled_appointment_count) as scheduled_appointment,&lt;BR /&gt;sum(virtual_scheduled_appointment_count) as virtual_scheduled_appointment&lt;BR /&gt;from&lt;BR /&gt;prep&lt;BR /&gt;group by&lt;BR /&gt;channel_grouping_session&lt;BR /&gt;order by&lt;BR /&gt;sessions desc;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Mar 2024 13:38:17 GMT</pubDate>
    <dc:creator>gjbankos1</dc:creator>
    <dc:date>2024-03-14T13:38:17Z</dc:date>
    <item>
      <title>use a query with the bigquery connector</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/use-a-query-with-the-bigquery-connector/m-p/2430831#M20197</link>
      <description>&lt;P&gt;I have this query that I want to use with the bigquery connector.&amp;nbsp; It looks like with the base functionality, you just pick tables and it pull the tables in.&amp;nbsp; I would like to run this query and pull the results back.&amp;nbsp; Can I do that with the bigquery connector?&lt;/P&gt;
&lt;P&gt;with prep as (&lt;BR /&gt;select&lt;BR /&gt;user_pseudo_id,&lt;BR /&gt;(select value.int_value from unnest(event_params) where key = 'ga_session_id') as session_id,&lt;BR /&gt;array_agg((select value.string_value from unnest(event_params) where key = 'source') ignore nulls order by event_timestamp)[safe_offset(0)] as source,&lt;BR /&gt;array_agg((select value.string_value from unnest(event_params) where key = 'medium') ignore nulls order by event_timestamp)[safe_offset(0)] as medium,&lt;BR /&gt;array_agg((select value.string_value from unnest(event_params) where key = 'campaign') ignore nulls order by event_timestamp)[safe_offset(0)] as campaign,&lt;BR /&gt;max((select value.string_value from unnest(event_params) where key = 'gclid')) as gclid,&lt;BR /&gt;countif(event_name = 'lead_completed') as lead_completed_count,&lt;BR /&gt;countif(event_name = 'phone_link_click') as phone_link_click_count,&lt;BR /&gt;countif(event_name = 'osc_chat_started') as osc_chat_started_count,&lt;BR /&gt;countif(event_name = 'osc_text_requested') as osc_text_requested_count,&lt;BR /&gt;countif(event_name = 'scheduled_appointment') as scheduled_appointment_count,&lt;BR /&gt;countif(event_name = 'virtual_scheduled_appointment') as virtual_scheduled_appointment_count&lt;BR /&gt;from&lt;BR /&gt;`ga4-tb-data.analytics_270728985.events_20240304`&lt;BR /&gt;group by&lt;BR /&gt;user_pseudo_id,&lt;BR /&gt;session_id&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;select&lt;BR /&gt;-- session default channel grouping (dimension | the channel group associated with a session) &lt;BR /&gt;case &lt;BR /&gt;when source = '(direct)' and (medium in ('(not set)','(none)')) then 'Direct'&lt;BR /&gt;when gclid is not null then 'Paid Search' -- Categorizing as Paid Search when gclid is not null&lt;BR /&gt;when regexp_contains(source,'Facebook|Instagram|Linkedin|Pinterest|Tiktok|Twitter|X')&lt;BR /&gt;and regexp_contains(medium,'Social') then 'Paid Social'&lt;BR /&gt;when regexp_contains(medium,'Display|DisplayNGDN|Display_NGDN') then 'Display'&lt;BR /&gt;when regexp_contains(source,'facebook|instagram|linkedin|pinterest|tiktok|twitter|whatsapp|linkin.bio')&lt;BR /&gt;or medium = 'Social' then 'Organic Social'&lt;BR /&gt;when regexp_contains(source,'baidu|bing|duckduckgo|ecosia|google|yahoo')&lt;BR /&gt;or medium = 'organic' then 'Organic Search'&lt;BR /&gt;when source = 'Tbmail' then 'Email'&lt;BR /&gt;when regexp_contains(source,'(newhomesource|realtor|trulia|zillow|livabl|redfin|newhomesourceprofessional|casasneuvasaqui|homes)') then 'Affiliates'&lt;BR /&gt;when medium = 'referral' then 'Referral'&lt;BR /&gt;when regexp_contains(source, 'yext|Yext') then 'Location Listings'&lt;BR /&gt;when regexp_contains(medium,'Offline Media|Print|Direct Mail|TBQR') then 'Offline Media'&lt;BR /&gt;else 'Unassigned' end as channel_grouping_session,&lt;BR /&gt;count(distinct concat(user_pseudo_id,session_id)) as sessions,&lt;BR /&gt;sum(lead_completed_count) as lead_completed,&lt;BR /&gt;sum(phone_link_click_count) as phone_link_click,&lt;BR /&gt;sum(osc_chat_started_count) as osc_chat_started,&lt;BR /&gt;sum(osc_text_requested_count) as osc_text_requested,&lt;BR /&gt;sum(scheduled_appointment_count) as scheduled_appointment,&lt;BR /&gt;sum(virtual_scheduled_appointment_count) as virtual_scheduled_appointment&lt;BR /&gt;from&lt;BR /&gt;prep&lt;BR /&gt;group by&lt;BR /&gt;channel_grouping_session&lt;BR /&gt;order by&lt;BR /&gt;sessions desc;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 13:38:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/use-a-query-with-the-bigquery-connector/m-p/2430831#M20197</guid>
      <dc:creator>gjbankos1</dc:creator>
      <dc:date>2024-03-14T13:38:17Z</dc:date>
    </item>
  </channel>
</rss>

