SlideShare ist ein Scribd-Unternehmen logo
1 von 10
Downloaden Sie, um offline zu lesen
in
     How to build
10   a metric in a metric

     Using BY in MAQL




            with Petr Olmer, GoodData Evangelist
What is a metric in a metric?

example 1: average monthly revenue
                                                              There are aggregations
    average from monthly numbers               outer level
                                                                  on two levels.
              total revenue
                                               inner level (by month)
             for each month




example 2: average number of new leads in a quarter

   average from quarterly numbers                           In most cases,
                                                    the aggregations are different.
          number of new leads
            for each quarter                                  Exception:
                                                         average of averages.
GoodData in10 with Petr Olmer: How to build a metric in a metric                       2
Solution

average monthly revenue

    average from monthly numbers                        Average Monthly Revenue:
                                                        SELECT AVG(Monthly Revenue)
              total revenue
             for each month                             Monthly Revenue:
                                                        SELECT SUM(Revenue) BY Close Month/Year




average number of new leads in a quarter

   average from quarterly numbers                       Average Quarterly Leads:
                                                        SELECT AVG(Quarterly Leads)
          number of new leads
            for each quarter                            Quarterly Leads:
                                                        SELECT COUNT(Lead) BY Created Quarter/Year


GoodData in10 with Petr Olmer: How to build a metric in a metric                                     3
Solution in detail

Average Monthly Revenue:
SELECT AVG(Monthly Revenue)
 Outer metric is an aggregation of the inner metric.


Monthly Revenue:
SELECT SUM(Revenue) BY Close Month/Year
Inner metric uses BY to define the aggregation level.


GoodData in10 with Petr Olmer: How to build a metric in a metric   4
Why BY?

You need to define the border between the inner aggregation and the outer one.


                 inner SUM                                         outer AVG

                                                 BY Month



      Without BY, the inner SUM would not know
     where to stop and hand over to the outer AVG.



GoodData in10 with Petr Olmer: How to build a metric in a metric                5
Behind the scenes



                 inner SUM                                           outer AVG

                                                 BY Month

                                              Nov 2010       $450K
                                              Dec 2010       $580K
                                               Jan 2011      $320K               $400K
                                              Feb 2011       $360K
                                             March 2011      $430K
                                              April 2011     $260K
                                                                                  your
    datamart                             behind the scenes                       report


GoodData in10 with Petr Olmer: How to build a metric in a metric                          6
Behind the scenes

                                  You’ve asked for one number and that’s what you get:
                                                            Average monthly revenue



The monthly report is computed but you cannot see it.




                                              Nov 2010       $450K
                                              Dec 2010       $580K
                                               Jan 2011      $320K         $400K
                                              Feb 2011       $360K
                                             March 2011      $430K
                                              April 2011     $260K
                                                                           your
    datamart                       report behind the scenes               report


GoodData in10 with Petr Olmer: How to build a metric in a metric                         7
Automatic (in-report) BY

You don’t need to use BY when the attribute is in the report.

    Month/Year          Revenue        Monthly Revenue      Revenue:
     Nov 2010               $450K           $450K           SELECT SUM(Revenue)
     Dec 2010               $580K           $580K
     Jan 2011               $320K           $320K           Monthly Revenue:
     Feb 2011               $360K           $360K           SELECT SUM(Revenue) BY Month/Year
    March 2011              $430K           $430K
     April 2011             $260K           $260K



             automatic BY
                                         Both metrics return the same numbers
                                       because Month/Year attribute is in the report.


    BY says: Include this attribute in the
    computation. But it’s already there!


GoodData in10 with Petr Olmer: How to build a metric in a metric                                8
BY and BY

You can include more than one attribute in the BY clause.

    SELECT SUM(Revenue) BY Month/Year, Department
    It will return a number for each month and department.

You can have a metric in a metric in a metric in a...
Best Region Leads:                                                 one number only

SELECT MAX(Average Monthly/Region Leads)
Average Monthly/Region Leads:        one number for each region
SELECT AVG(Month/Region Leads) BY Region
Month/Region Leads:          one number for each month and region
SELECT COUNT(Lead) BY Month/Year, Region
GoodData in10 with Petr Olmer: How to build a metric in a metric                     9
Off you go...

Find the border.

                              average from region numbers

                                        total revenue
                                       for each region




Put BY into the inner metric.
                         SELECT SUM(Revenue) BY Region




GoodData in10 with Petr Olmer: How to build a metric in a metric   10

Weitere ähnliche Inhalte

Andere mochten auch

Affiliate program v telco segmentu
Affiliate program v telco segmentuAffiliate program v telco segmentu
Affiliate program v telco segmentuColpirio.com s.r.o.
 
Nabil Malik - Security performance metrics
Nabil Malik - Security performance metricsNabil Malik - Security performance metrics
Nabil Malik - Security performance metricsnooralmousa
 
Metrics & Analytics That Matter - Steve Krull, CEO, Be Found Online
Metrics & Analytics That Matter - Steve Krull, CEO, Be Found OnlineMetrics & Analytics That Matter - Steve Krull, CEO, Be Found Online
Metrics & Analytics That Matter - Steve Krull, CEO, Be Found OnlineBrightEdge Technologies
 
Lean Workbench For Creating And Tracking Metrics That Matter
Lean Workbench For Creating And Tracking Metrics That MatterLean Workbench For Creating And Tracking Metrics That Matter
Lean Workbench For Creating And Tracking Metrics That MatterJennifer Rubinovitz
 
DataPower Operations Dashboard
DataPower Operations DashboardDataPower Operations Dashboard
DataPower Operations DashboardIBM Integration
 
Analytics and Reporting: Measuring Success Along the Journey
Analytics and Reporting: Measuring Success Along the JourneyAnalytics and Reporting: Measuring Success Along the Journey
Analytics and Reporting: Measuring Success Along the JourneyGene Begin
 
Security Metrics Program
Security Metrics ProgramSecurity Metrics Program
Security Metrics ProgramCydney Davis
 

Andere mochten auch (11)

Affiliate program v telco segmentu
Affiliate program v telco segmentuAffiliate program v telco segmentu
Affiliate program v telco segmentu
 
Nabil Malik - Security performance metrics
Nabil Malik - Security performance metricsNabil Malik - Security performance metrics
Nabil Malik - Security performance metrics
 
Measuring Effectiveness
Measuring EffectivenessMeasuring Effectiveness
Measuring Effectiveness
 
Helpdesk
HelpdeskHelpdesk
Helpdesk
 
Metrics & Analytics That Matter - Steve Krull, CEO, Be Found Online
Metrics & Analytics That Matter - Steve Krull, CEO, Be Found OnlineMetrics & Analytics That Matter - Steve Krull, CEO, Be Found Online
Metrics & Analytics That Matter - Steve Krull, CEO, Be Found Online
 
Lean Workbench For Creating And Tracking Metrics That Matter
Lean Workbench For Creating And Tracking Metrics That MatterLean Workbench For Creating And Tracking Metrics That Matter
Lean Workbench For Creating And Tracking Metrics That Matter
 
DataPower Operations Dashboard
DataPower Operations DashboardDataPower Operations Dashboard
DataPower Operations Dashboard
 
Action Trumps Everything
Action Trumps EverythingAction Trumps Everything
Action Trumps Everything
 
Analytics and Reporting: Measuring Success Along the Journey
Analytics and Reporting: Measuring Success Along the JourneyAnalytics and Reporting: Measuring Success Along the Journey
Analytics and Reporting: Measuring Success Along the Journey
 
Metrics that Matter
Metrics that MatterMetrics that Matter
Metrics that Matter
 
Security Metrics Program
Security Metrics ProgramSecurity Metrics Program
Security Metrics Program
 

Ähnlich wie in10: How to build a metric in a metric

Kessan 1708682945115077
Kessan 1708682945115077Kessan 1708682945115077
Kessan 1708682945115077yoshikawa0521
 
Analysis Samples
Analysis SamplesAnalysis Samples
Analysis Sampleschuckullan
 
3 Red Shells Wireless Program Audit - Sample
3 Red Shells Wireless Program Audit - Sample3 Red Shells Wireless Program Audit - Sample
3 Red Shells Wireless Program Audit - Sample3 Red Shells
 
Busn 5200 managerial finance complete class
Busn 5200 managerial finance complete classBusn 5200 managerial finance complete class
Busn 5200 managerial finance complete classWalter Bartlett
 
FifthThird 3Q08 Release_Final
FifthThird 3Q08 Release_FinalFifthThird 3Q08 Release_Final
FifthThird 3Q08 Release_Finalfinance28
 
FifthThird3Q08Release_Final
FifthThird3Q08Release_FinalFifthThird3Q08Release_Final
FifthThird3Q08Release_Finalfinance28
 
Adobe Q4 and FY2008 earnings release
Adobe Q4 and FY2008 earnings releaseAdobe Q4 and FY2008 earnings release
Adobe Q4 and FY2008 earnings releaseearningsreport
 
Yelp q4 2014 earnings slides
Yelp q4 2014 earnings slidesYelp q4 2014 earnings slides
Yelp q4 2014 earnings slidesvikas0707
 
Dashboards By Function Powerpoint Presentation Slides
Dashboards By Function Powerpoint Presentation SlidesDashboards By Function Powerpoint Presentation Slides
Dashboards By Function Powerpoint Presentation SlidesSlideTeam
 
The blackstone group quarterly reports
The blackstone group quarterly reportsThe blackstone group quarterly reports
The blackstone group quarterly reportsrynbouc
 
Power BI Touche(Point of Sale )
Power BI Touche(Point of Sale )Power BI Touche(Point of Sale )
Power BI Touche(Point of Sale )Vipinder Panchal
 
Living on a budget answer sheet
Living on a budget answer sheetLiving on a budget answer sheet
Living on a budget answer sheetNAFCareerAcads
 
Predictive automated margin trading technology part 3
Predictive automated margin trading technology part 3Predictive automated margin trading technology part 3
Predictive automated margin trading technology part 3Yuri Martemianov
 
"Driving SaaS Success Using Key Metrics" at SaaStr Annual 2016
"Driving SaaS Success Using Key Metrics" at SaaStr Annual 2016"Driving SaaS Success Using Key Metrics" at SaaStr Annual 2016
"Driving SaaS Success Using Key Metrics" at SaaStr Annual 2016saastr
 
Rpgj March10
Rpgj March10Rpgj March10
Rpgj March10Neil Ward
 
Mythbusters for 360 short
Mythbusters for 360 shortMythbusters for 360 short
Mythbusters for 360 shortWWF-Australia
 

Ähnlich wie in10: How to build a metric in a metric (20)

Kessan 1708682945115077
Kessan 1708682945115077Kessan 1708682945115077
Kessan 1708682945115077
 
Analysis Samples
Analysis SamplesAnalysis Samples
Analysis Samples
 
3 Red Shells Wireless Program Audit - Sample
3 Red Shells Wireless Program Audit - Sample3 Red Shells Wireless Program Audit - Sample
3 Red Shells Wireless Program Audit - Sample
 
CiaB_Presentation
CiaB_PresentationCiaB_Presentation
CiaB_Presentation
 
Busn 5200 managerial finance complete class
Busn 5200 managerial finance complete classBusn 5200 managerial finance complete class
Busn 5200 managerial finance complete class
 
FifthThird 3Q08 Release_Final
FifthThird 3Q08 Release_FinalFifthThird 3Q08 Release_Final
FifthThird 3Q08 Release_Final
 
FifthThird3Q08Release_Final
FifthThird3Q08Release_FinalFifthThird3Q08Release_Final
FifthThird3Q08Release_Final
 
Adobe Q4 and FY2008 earnings release
Adobe Q4 and FY2008 earnings releaseAdobe Q4 and FY2008 earnings release
Adobe Q4 and FY2008 earnings release
 
KMSFeedback Example DEC 2015
KMSFeedback Example DEC 2015KMSFeedback Example DEC 2015
KMSFeedback Example DEC 2015
 
Yelp q4 2014 earnings slides
Yelp q4 2014 earnings slidesYelp q4 2014 earnings slides
Yelp q4 2014 earnings slides
 
Dashboards By Function Powerpoint Presentation Slides
Dashboards By Function Powerpoint Presentation SlidesDashboards By Function Powerpoint Presentation Slides
Dashboards By Function Powerpoint Presentation Slides
 
Budgeting
BudgetingBudgeting
Budgeting
 
The blackstone group quarterly reports
The blackstone group quarterly reportsThe blackstone group quarterly reports
The blackstone group quarterly reports
 
Power BI Touche(Point of Sale )
Power BI Touche(Point of Sale )Power BI Touche(Point of Sale )
Power BI Touche(Point of Sale )
 
Living on a budget answer sheet
Living on a budget answer sheetLiving on a budget answer sheet
Living on a budget answer sheet
 
Predictive automated margin trading technology part 3
Predictive automated margin trading technology part 3Predictive automated margin trading technology part 3
Predictive automated margin trading technology part 3
 
"Driving SaaS Success Using Key Metrics" at SaaStr Annual 2016
"Driving SaaS Success Using Key Metrics" at SaaStr Annual 2016"Driving SaaS Success Using Key Metrics" at SaaStr Annual 2016
"Driving SaaS Success Using Key Metrics" at SaaStr Annual 2016
 
Rpgj March10
Rpgj March10Rpgj March10
Rpgj March10
 
Belajar SQL
Belajar SQLBelajar SQL
Belajar SQL
 
Mythbusters for 360 short
Mythbusters for 360 shortMythbusters for 360 short
Mythbusters for 360 short
 

Mehr von Petr Olmer

The World Through The Lens Of A Two-Year-Old
The World Through The Lens Of A Two-Year-OldThe World Through The Lens Of A Two-Year-Old
The World Through The Lens Of A Two-Year-OldPetr Olmer
 
How to scale (with Big Data)
How to scale (with Big Data)How to scale (with Big Data)
How to scale (with Big Data)Petr Olmer
 
Do Ameriky (WebExpo Prague 2012)
Do Ameriky (WebExpo Prague 2012)Do Ameriky (WebExpo Prague 2012)
Do Ameriky (WebExpo Prague 2012)Petr Olmer
 
Embed GoodData Analytics in Your Force.com App
Embed GoodData Analytics in Your Force.com AppEmbed GoodData Analytics in Your Force.com App
Embed GoodData Analytics in Your Force.com AppPetr Olmer
 
in10: How to start with GoodData for Salesforce
in10: How to start with GoodData for Salesforcein10: How to start with GoodData for Salesforce
in10: How to start with GoodData for SalesforcePetr Olmer
 
Business Intelligence Platform as a Service: Introduction to GoodData
Business Intelligence Platform as a Service: Introduction to GoodDataBusiness Intelligence Platform as a Service: Introduction to GoodData
Business Intelligence Platform as a Service: Introduction to GoodDataPetr Olmer
 

Mehr von Petr Olmer (6)

The World Through The Lens Of A Two-Year-Old
The World Through The Lens Of A Two-Year-OldThe World Through The Lens Of A Two-Year-Old
The World Through The Lens Of A Two-Year-Old
 
How to scale (with Big Data)
How to scale (with Big Data)How to scale (with Big Data)
How to scale (with Big Data)
 
Do Ameriky (WebExpo Prague 2012)
Do Ameriky (WebExpo Prague 2012)Do Ameriky (WebExpo Prague 2012)
Do Ameriky (WebExpo Prague 2012)
 
Embed GoodData Analytics in Your Force.com App
Embed GoodData Analytics in Your Force.com AppEmbed GoodData Analytics in Your Force.com App
Embed GoodData Analytics in Your Force.com App
 
in10: How to start with GoodData for Salesforce
in10: How to start with GoodData for Salesforcein10: How to start with GoodData for Salesforce
in10: How to start with GoodData for Salesforce
 
Business Intelligence Platform as a Service: Introduction to GoodData
Business Intelligence Platform as a Service: Introduction to GoodDataBusiness Intelligence Platform as a Service: Introduction to GoodData
Business Intelligence Platform as a Service: Introduction to GoodData
 

Kürzlich hochgeladen

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

Kürzlich hochgeladen (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

in10: How to build a metric in a metric

  • 1. in How to build 10 a metric in a metric Using BY in MAQL with Petr Olmer, GoodData Evangelist
  • 2. What is a metric in a metric? example 1: average monthly revenue There are aggregations average from monthly numbers outer level on two levels. total revenue inner level (by month) for each month example 2: average number of new leads in a quarter average from quarterly numbers In most cases, the aggregations are different. number of new leads for each quarter Exception: average of averages. GoodData in10 with Petr Olmer: How to build a metric in a metric 2
  • 3. Solution average monthly revenue average from monthly numbers Average Monthly Revenue: SELECT AVG(Monthly Revenue) total revenue for each month Monthly Revenue: SELECT SUM(Revenue) BY Close Month/Year average number of new leads in a quarter average from quarterly numbers Average Quarterly Leads: SELECT AVG(Quarterly Leads) number of new leads for each quarter Quarterly Leads: SELECT COUNT(Lead) BY Created Quarter/Year GoodData in10 with Petr Olmer: How to build a metric in a metric 3
  • 4. Solution in detail Average Monthly Revenue: SELECT AVG(Monthly Revenue) Outer metric is an aggregation of the inner metric. Monthly Revenue: SELECT SUM(Revenue) BY Close Month/Year Inner metric uses BY to define the aggregation level. GoodData in10 with Petr Olmer: How to build a metric in a metric 4
  • 5. Why BY? You need to define the border between the inner aggregation and the outer one. inner SUM outer AVG BY Month Without BY, the inner SUM would not know where to stop and hand over to the outer AVG. GoodData in10 with Petr Olmer: How to build a metric in a metric 5
  • 6. Behind the scenes inner SUM outer AVG BY Month Nov 2010 $450K Dec 2010 $580K Jan 2011 $320K $400K Feb 2011 $360K March 2011 $430K April 2011 $260K your datamart behind the scenes report GoodData in10 with Petr Olmer: How to build a metric in a metric 6
  • 7. Behind the scenes You’ve asked for one number and that’s what you get: Average monthly revenue The monthly report is computed but you cannot see it. Nov 2010 $450K Dec 2010 $580K Jan 2011 $320K $400K Feb 2011 $360K March 2011 $430K April 2011 $260K your datamart report behind the scenes report GoodData in10 with Petr Olmer: How to build a metric in a metric 7
  • 8. Automatic (in-report) BY You don’t need to use BY when the attribute is in the report. Month/Year Revenue Monthly Revenue Revenue: Nov 2010 $450K $450K SELECT SUM(Revenue) Dec 2010 $580K $580K Jan 2011 $320K $320K Monthly Revenue: Feb 2011 $360K $360K SELECT SUM(Revenue) BY Month/Year March 2011 $430K $430K April 2011 $260K $260K automatic BY Both metrics return the same numbers because Month/Year attribute is in the report. BY says: Include this attribute in the computation. But it’s already there! GoodData in10 with Petr Olmer: How to build a metric in a metric 8
  • 9. BY and BY You can include more than one attribute in the BY clause. SELECT SUM(Revenue) BY Month/Year, Department It will return a number for each month and department. You can have a metric in a metric in a metric in a... Best Region Leads: one number only SELECT MAX(Average Monthly/Region Leads) Average Monthly/Region Leads: one number for each region SELECT AVG(Month/Region Leads) BY Region Month/Region Leads: one number for each month and region SELECT COUNT(Lead) BY Month/Year, Region GoodData in10 with Petr Olmer: How to build a metric in a metric 9
  • 10. Off you go... Find the border. average from region numbers total revenue for each region Put BY into the inner metric. SELECT SUM(Revenue) BY Region GoodData in10 with Petr Olmer: How to build a metric in a metric 10