SlideShare une entreprise Scribd logo
1  sur  10
Télécharger pour lire hors ligne
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

Contenu connexe

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Plus de 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
 

Plus de 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
 

Dernier

Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Dernier (20)

Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

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