SQL vs SOQL for Salesforce Analytics Ani Jain, Senior Product Marketing Manager, MicroStrategy Jeff Leinbach, Principal Software Engineer, Progress DataDirect Lori Mehen, Product Marketing Manager, Progress DataDirect
SQL vs SOQL for
Salesforce Analytics
Ani Jain, Senior Product Marketing Manager,
MicroStrategy
Jeff Leinbach, Principal Software Engineer,
Progress DataDirect
Lori Mehen, Product Marketing Manager,
Progress DataDirect
© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.2
Audio Bridge Options & Question Submission
SQL vs SOQL for
Salesforce Analytics
Ani Jain, Senior Product Marketing Manager,
MicroStrategy
Jeff Leinbach, Principal Software Engineer,
Progress DataDirect
Lori Mehen, Product Marketing Manager,
Progress DataDirect
Agenda
At a glance
• Contrast SQL vs SOQL queries for analytics
• How to get SQL access to Salesforce data
• MicroStrategy connectivity to Salesforce.com
• Why use MicroStrategy with Salesforce.com for analytics
© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.6
SQL is the query language for analyticsWhat is SOQL?
SOQL is Salesforce Object Query Language
Salesforce is a multi-tenant system where many users are sharing
a database
• SOQL provides a means by which Salesforce can prevent queries from
adversely affecting customers who rely on shared resources
Salesforce has an object based data model
• SOQL provides an object-like manner in which to query for information
easing data access for developers
© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.7
SOQL capabilities
SOQL is a SELECT-like query language for
accessing objects
Field selection
Filters
Limited joins
Limited Group Bys
Aggregates
Order By
© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.8
Field Selection
SQL SOQL
Ability to pick which columns to
use in the select list
wildcards like star to indicate all
columns
SELECT * FROM ACCOUNT SELECT * FROM Account
SELECT Id, Name FROM
Account
© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.9
Filters
SQL SOQL
Supports filter operations …FROM Account WHERE
Name LIKE ‘ABC%’
…FROM Account WHERE
(Name = ‘Col%’ AND State =
‘NC’) OR Name = ‘Barber’
Similar to SQL
Allows functions in filters …FROM Account WHERE
CALENDAR_YEAR(CreatedD
ate) = 2011
Similar to SQL
Allows specifying timestamps
using escapes
…FROM Account WHERE
CreatedDate = {ts ‘2010-08-10
09:15:37’}
…FROM Account WHERE
CreatedDate = {ts ‘2010-08-10
09:15:37’}
…FROM Account WHERE
CreatedDate = 2010-08-
10T09:15:37
© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.10
Filters (continued)
SQL SOQL
Supports filter operations …FROM Account WHERE
Name LIKE ‘ABC%’
…FROM Account WHERE
(Name = ‘Col%’ AND State =
‘NC’) OR Name = ‘Barber’
Similar to SQL
Multi-select picklists
Use equivalent string functions …FROM Account WHERE MenuItem = ‘AAA’
…FROM Account WHERE MenuItem != ‘AAA’
…FROM Account WHERE MenuItem includes
‘AAA’
…FROM Account WHERE MenuItem
excludes ‘AAA’
…FROM Account WHERE MenuItem =
‘AAA;BBB’
Allows filtering on polymorphic
relationships Use equivalent join syntax
SELECT Id, Name FROM
Event WHERE What.Type In
(‘Account’, ‘Opportunity’)
© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.11
Joins
SQL SOQL
Joins across any tables or objects SQL allows JOINs of all kindsThese examples use a foreign key
SELECT * FROM Account A
INNER JOIN Contacts C on A.ID
= C.AccountID
SELECT * FROM Account A
FULL OUTER JOIN Contacts C
on A.ID = C.AccountID
SELECT * FROM Account A
FULL OUTER JOIN Contacts C
on A.ID = C.AccountID WHERE
A.ID IS NULL or C.AccountID IS
NULL
This example joins on an arbitrary field
SELECT * FROM Account A
INNER JOIN Contacts C ON
A.State AND C.State WHERE
A.ZipCode = C.ZipCode
SOQL only allows joins on foreign
keys through relationship queriesThis is achieved through either dot
notation following child-to-parent
relationships:
SELECT Contact.Name,
Contact.Account.Name FROM
Contact WHERE…
Or through sub-queries when following
parent-to-child relationships
SELECT Account.Name,
(SELECT Contact.FirstName,
Contact.LastName FROM
Account.Contacts) FROM
Account WHERE…
© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.12
Aggregates, Group By, Order By
SQL SOQL
Supports Aggregates, Group By,
Order By
SELECT SUM(Amount),
FiscalQuarter, Probability
FROM Opportunity GROUP
BY FiscalQuarter, Probability
Similar to SQL
Unlimited Aggregation
SELECT SUM(Amount),
FiscalQuarter, Probability
FROM Opportunity GROUP
BY FiscalQuarter, Probability
SOQL does not allow a query
containing a Group By to
return more than 2000
records. Add a Having or
Where clause to limit the
results.SELECT SUM(Amount),
FiscalQuarter, Probability FROM
Opportunity GROUP BY
FiscalQuarter, Probability HAVING
SUM(Amount) > 10000
© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.13
Inserts, Updates, Deletes
SQL SOQL
Syntax for DML operations
In Salesforce, Insert, Update
and Delete operations are
performed through APIs
Writes in single operation
SQL simplifies the process as
a single query can modify the
data
For updates and deletes, a
SOQL query must be used to
identify the records to modify,
so it’s a 2 step process
© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.15
First, why SQL access to Salesforce?
• Analytics applications and professionals expect SQL
• Standard SQL access instantly connects thousands of standard
applications to the Salesforce Platform
• [Learn more] DataDirect SQL access featured at Dreamforce in the
Developer Zone
© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.16
Popular options for SQL access to Salesforce
Direct SQL Access
Progress DataDirect ODBC and JDBC
drivers for direct SQL connectivity
[Download] bit.ly/SQL2SF
Indirect SQL Access
Extract data using Salesforce data loader,
or other third party tools, into an
intermediate RDBMS
app
© 2016 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.17
DataDirect architecture for direct SQL access to Salesforce
Progress DataDirect
ODBC/JDBC
Connectors
Schema Manager
BI Application
Salesforce.com
Schema
User Defined
Schema
Driver uses
SOAP API
Bulk API
Metadata API
Salesforce.com and MicroStrategy
A functional overview and recommendation for analysis
and application development
Agenda
At a glance
• MicroStrategy connectivity to Salesforce.com
• Why use MicroStrategy with Salesforce.com for analytics
A Unified Platform for Enterprise Analytics, Mobility, and Security
Analytics applications
that blend every form of data and
deliver insights to users via reports,
dashboards, and apps.
Mobility applications
that source information from multiple
locations, and submit transactions to
your ERP systems.
Security applications
that secure your most sensitive
information and resources with
digital security badges.
A powerful Business Intelligence solution that meets the needs of Business and IT in a single platform.
Best for ITBest for business
Data Discovery and
Visualization
• Exceptionally Ease of Use
• Schema-free
• Data Preparation + Blending
• Rapid Prototyping
• Agile and Visual Analysis
• Reusable Object Model
• Unified Secure Architecture
• Single Metadata
• Optimized Multi-Source Data Access
• Design Once Deploy Everywhere
• Enterprise Reporting on any Device
• Highest User Scale
• Highest Data Scale
• Fastest Query Performance
• Secure, Personalized Analytics for 10,000s
MicroStrategy Desktop MicroStrategy Analytics Platform
Rapid | Intuitive Powerful | Scalable | Extensible | Governed | Highly Performant | Secure
Geo-Spatial
AnalysisMobile
Applications
Real-time
Transactions
Interactive
Dashboards
Advanced
VisualizationsBanded
Reports
OLAP
Reports
Data
Discovery
Predictive
Analytics
Alerts &
Distribution
MicroStrategy 10
How MicroStrategy integrates with Salesforce.com
Connectivity options
• Security
• Performance and Scalability
• Administration/Automation
• Distribution and Alerting
• In-Memory
• Adv. Analytics
• Mobile
• Dashboards and Visualizations
• Multi-source
and more….
Report Import
Import Salesforce.com standard and user defined reports
into MicroStrategy.
ODBC
Query Salesforce.com objects like any other relational
source.
Web Services
Connect to Salesforce.com data using a native web
services connector.
ETL
Export Salesforce.com data onto a DWH and use
MicroStrategy with the DWH
MicroStrategy
Architect
Or
MicroStrategy
Data Import
MicroStrategy
Data Import
Benefit from the power
of MicroStrategy
MicroStrategy Connectivity
Support Matrix for connectivity options
Live Access In-memory Write-back DataDynamic Query
Generation
MicroStrategy
Functionality
Report
ImportNo Yes No
Only Salesforce
ReportsNo
Some MicroStrategy
functionality not
available like custom
groups, consolidations
ODBC Yes Yes Yes
Some restricted
tables are not
available
Yes All
Web
ServicesYes Yes Yes All SF.com data No
Some MicroStrategy
functionality not
available like custom
groups, consolidations
ETL > DB Yes Yes NA All SF.com data Yes All
Multiple Options to connect to Salesforce data
Considerations for when to use Architect and when to use Data Import when using ODBC
MicroStrategy Architect Application Level: For access to all MicroStrategy
functionality like Prompts, Hierarchies
Data Level: Allows you to create a enterprise-wide
logical data model and handle more complex
scenarios.
Data Import Application Level: Some functionality like prompts,
and hierarchies not available
Data Level: Provides much faster turnaround time
(auto metadata detection, auto geo mapping, etc.).
Is suitable for subject-oriented analysis
Salesforce.com analytics options
Two different options
Salesforce Reports and Dashboards
What it is Operational reporting on Salesforce data to get snapshot of CRM
Used for Basic Metrics and static reporting
Data Salesforce only
Historical 90-days analysis
Cost Free with Salesforce.com
Salesforce Dashboards have limited capabilities
Basic dashboards
No ad-hoc exploration
Limited mobile functionality
Basic visualizations
Salesforce.com analytics options
Two different options
Salesforce Wave
What it is Launched new capabilities in 2014. Provides pre-built apps
and platform for analytics
Used for More interactive and visual than Salesforce Reports but has
many limitations
Data External data can be used
Cost Additional platform and per user costs
Salesforce.com Wave Analytics
Limitations
New product missing many capabilities commonly available in most BI tools.
Geospatial capabilities; self-service data preparation; internationalization, Dynamic Dashboards, Export to other
formats, administration, limited visualizations, etc.
No support for analytics outside of SFDC users.
All data required for analytics must be loaded into Wave. Cannot report directly on source data.
Struggles to provide more complex analysis
Releases are not staggered
Only option to deploy is through Cloud
Cost are high and require platform costs + per use costs high
Top reasons why customers choose MicroStrategy for Salesforce.com
1. Easier data access from multiple sources
EDW
Access data from where it resides
Connect to all major data sources DBs, Files, Cloud
Sources, Big Data sources
Flexibility to perform enterprise-wide data modeling or
analyst driven data mashups
Top reasons why customers choose MicroStrategy for Salesforce.com
2. Richer dashboards and visualizations
Powerful design surface for
enterprise-grade apps
Extensible visualizations
Geo analysis
Why customers choose MicroStrategy for Salesforce.com
3. Powerful analytical capabilities
34
Industry’s most powerful SQL Engine and 300+ native analytical functions
Projections
Relationship Analysis
Benchmarking
Trend Analysis
Data Summarization
What is likely to happen based on past history?
What factors influence activity or behavior?
How are we doing versus comparables?
What direction are we headed in?
What is happening in the aggregate?
Optimization What do we want to happen?
Specialty Tools
Integration with 3rd
party tools like SAS,
R, and SPSS for
additional capabilities
300+ analytical
functions out-of-
the-box provide
enough capabilities
for most
organizations
Why customers choose MicroStrategy for Salesforce.com
4. Superior mobile capabilities to build powerful sales productivity apps
Analytics
• Powerful, advanced
analytics
• Data visualizations
and explorations
• Automatic data
updates
Transactions
• Touch-based inputs
• Offline transactions
• Image capture
Multimedia
• Videos
• PDFs
• Browser
content
Collaboration Geospatial
• ESRI maps
• Google Maps
• Image Layout
Widget
• Data-based team
discussions
• Annotate and share
• Integration with Apple TV
Why customers choose MicroStrategy for Salesforce.com
5. Personalized report delivery and proactive notifications help improve business efficiency
Mass distribution of personalized content
Proactive notification and exception based alerting
Event- and time-based delivery
Why customers choose MicroStrategy for Salesforce.com
6. Powerful data exploration and preparation for rapid iterative analysis
Best in class data discovery functionality Integrated data cleansing and
preparation capabilities
Why customers choose MicroStrategy for Salesforce.com
7. Embedded Analytics
Embed power of MicroStrategy
right within Salesforce.com
Allow single sign-on and fully
leverage the salesforce.com
security model
What can you do with MicroStrategy
Some examples
Multi-source and
easier data
access
Richer
dashboard /
visualizations
capabilities
Advanced
analytics
Stunning mobile
apps that allow
write-back
Distribution and
proactive
notifications
Exploratory data
analysis and
data wrangling
Embedded
analytics
Management looks at dashboard that combines information from salesforce.com, marketing automation system and homegrown employee management system to provide a 3600 view of business. The data resides in their respective sources
VP of sales starts with a summary view of opportunity data and then drills into individual regions. He compares current opportunities with historical data and gets insights into how well each regions is performing. He then drills into detailed sales rep activity.
CXOs looks at analysis that provide correlation of marketing spend on number of opportunities and realized revenue. They perform what-if analysis to determine marketing spend to achieve the sales targets for the next quarter.
Sales rep reads from and writes back to built-in and custom Salesforce.com objects to gain instant visibility into Accounts, Leads, Contracts, Opportunities, and more using a single Mobile App powered by MicroStrategy.
Competitive Intelligence team stays on top of market dynamics by automatically receiving reports when a deal with a specific competitor is closed or lost. The team sets criteria like deal size and competitors involved for receiving such emails.
Data analysts from across the company perform ad-hoc data exploration to gain and share insights. They use slaesforce. .com data and easily combine it with other data sources like social media, EDW Big Data sources or flat files to perform their analysis.
Information systems team embed MicroStrategy directly inside salesforce.com to provide a seamless experience to their salesforce.com users. The users can now see deep and relevant analytics right within salesforce.com
Conclusion: Benefit from the best of both worlds
Salesforce is a leader for CRM. MicroStrategy is the leader for Analytics
Analytics Leader in Analytics Space New entrant
Sales
Force
Automatio
n
NA Leader in sales force automation