EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB14354: Metric values for summary metrics are not displayed in conjunction with report level metrics when preserving attribute elements in MicroStrategy Engine


Community Admin

• Strategy


A user wishes to display a grand total metric alongside a report level metric in the same report. The report level metric is also sparse or deficient with respect to the lookup tables for the template attributes -- that is, some of the attribute elements will not be reflected in that metric's result set. The user also wishes to display all of the attribute elements in the lookup table, with null metric values for the rows not present in the metric result set.

SYMPTOM:
A user wishes to display a grand total metric alongside a report level metric in the same report. The report level metric is also sparse or deficient with respect to the lookup tables for the template attributes -- that is, some of the attribute elements will not be reflected in that metric's result set. The user also wishes to display all of the attribute elements in the lookup table, with null metric values for the rows not present in the metric result set.
 
For the purpose of this example, a conditional metric will be used to simulate a metric calculation that would be be obtained from a sparse fact table. Note also that the Count metric may use any formula; what is significant is that its dimensionality is empty, meaning that it will not group by any attribute. The issue may also occur for metrics that have attributes in the dimensionality but which are higher than template level.
 
The report is defined as follows.
 

ka04W000000OhjhQAC_0EM440000002FRi.gif

 
In the Report Data Options editor, the Attribute Join Type is set to 'Preserve lookup table elements joined to final pass result elements based on template attributes with filter,' as shown below:
 

ka04W000000OhjhQAC_0EM440000002FRm.gif

 
When the report is executed, the following results are obtained:
 

ka04W000000OhjhQAC_0EM440000002FRu.gif

 
However, if the report level metric is removed from the report, the correct value for the grand total metric appears, as shown below:
 

ka04W000000OhjhQAC_0EM440000002FRo.gif

 
CAUSE:
This issue occurs because of the way outer joins are evaluated on the database when metrics of differing dimensionalities are involved.
 
The SQL for the complete report is as follows:
 


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  

The final result from the database is:
 


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  


SQL PassExplanationselect   a12.REGION_ID REGION_ID,
   sum(a11.TOT_DOLLAR_SALES) WJXBFS1
into #ZZMD00
from   CITY_CTR_SLS   a11
   join   LU_CALL_CTR   a12
    on    (a11.CALL_CTR_ID = a12.CALL_CTR_ID)
where   a12.REGION_ID in (2, 3, 5)
group by   a12.REGION_IDCompute the report level metric. Only some of the Regions in the warehouse will appear in the result.select   count(distinct a11.ORDER_ID) WJXBFS1
into #ZZMD01
from   ORDER_FACT   a11Compute the total number of orders across the entire warehouse.select   pa11.REGION_ID REGION_ID,
   pa11.WJXBFS1 WJXBFS1,
   pa12.WJXBFS1 WJXBFS2
into #ZZOL02
from   #ZZMD00   pa11
   cross join   #ZZMD01   pa12Join the metric results into a single table. This result will have three rows, one for each region allowed in the filter, with the same Count value for each row.select   a11.REGION_ID REGION_ID,
   a11.REGION_NAME REGION_NAME,
   pa12.WJXBFS1 WJXBFS1,
   pa12.WJXBFS2 WJXBFS2
from   LU_REGION   a11
   left outer join   #ZZOL02   pa12
    on    (a11.REGION_ID = pa12.REGION_ID)Obtain all the Region attribute elements, outer joined to the result set. The Count metric will exist in this dataset only in rows that have a Revenue value.RegionRevenueCountNortheast  Mid-Atlantic3,413,340200,000Southeast2,016,186200,000Central  South1,380,991200,000Northwest  Southwest  England  France  Germany  Canada  Web  

In this data set, the Revenue metric is correct. The Count metric, however, is expected to have the same value across every row because its dimensionality is empty. In fact, there are two distinct values: 200,000 and null. In the report display phase, one of those two values will be associated with the single element that always results from an empty dimensionality, and that metric value will be propagated over every row.
 
When the value that is chosen is null, then the metric value will be suppressed.
 
ACTION:
To resolve the problem, the SQL needs to be modified to ensure that the Count metric preserves the value across every row of the final result. To do this, the Downward Outer Join VLDB property must be enabled with the 'Preserve all the rows for metrics higher than template level with report filter,' as shown below:
 

ka04W000000OhjhQAC_0EM440000002FRk.gif

 
Where the initial report SQL consolidated the metric results before joining to the attribute elements from the lookup table, with the Downward Outer Join setting enabled, the SQL will obtain all the necessary attribute elements first, and then consolidate the metric results with respect to those elements. Thus the higher level metric will be populated for every row and the report will display correctly.
 
Consult the following Strategy Knowledge Base Technical Note for more information on the Downward Outer Join VLDB property:
KB11122: What is the “Downward Outer Join” VLDB property in MicroStrategy SQL Generation Engine?​
 


Comment

0 comments

Details

Knowledge Article

Published:

April 18, 2017

Last Updated:

April 18, 2017