Skip to content

Instantly share code, notes, and snippets.

@kiyoto
Created March 14, 2017 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kiyoto/b0f4c1d42dd08f8c36dc293381595410 to your computer and use it in GitHub Desktop.
Save kiyoto/b0f4c1d42dd08f8c36dc293381595410 to your computer and use it in GitHub Desktop.
Find the companies that use Google Analytics and Adobe Analytics
SELECT
name,
region__c AS region,
industry,
CASE WHEN REGEXP_LIKE(COALESCE(LOWER(clearbit_technologies__c),''), '(adobe analytics|omniture)') THEN 1 ELSE 0 END AS has_adobe_analytics,
CASE WHEN LOWER(COALESCE(clearbit_technologies__c,'')) LIKE '%google analytics%' THEN 1 ELSE 0 END AS has_google_analytics,
CASE WHEN numberofemployees > 100000 THEN '6. 100000 or more'
WHEN numberofemployees >= 10000 THEN '5. 10,000~99999'
WHEN numberofemployees >= 1000 THEN '4. 1,000~9999'
WHEN numberofemployees >= 100 THEN '3. 100~999'
WHEN numberofemployees >= 10 THEN '2. 10~99'
WHEN numberofemployees < 10 THEN '1. Less than 10'
END as employee_num_buckets
FROM "sfdc"."account"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment