In some cases, the SQL view for certain reports shows different branches. This happens only when reports hit partitioned base tables (PBTs). When users switch from the editor mode to the SQL view mode without executing the report first, the Strategy SQL Generation Engine 8.x does not know yet what the SQL will look like. Thus, three distinct possible cases are shown. Each one of these possible scenarios is a branch. For more information about how to set up a project using partitioned tables, refer to the following Strategy Knowledge Base technical note:
KB5529: How to set up a project using partition mapping tables in MicroStrategy Architect 9.4.x - 10.x.
The Strategy Tutorial project is used to explain this behavior and the sample report SQL:
Metric:
M1 = Sum() {~+}
Report:

Filter:
Year = 2006
The SQL generated by this report (before running) is the following:
select distinct a11. AS PBTNAME
from a11,
a12
where a11. = a12.
and a12. in (2006)
create table ZZPO00 ( MONTH_ID LONG, CATEGORY_ID BYTE, WJXBFS1 DOUBLE)
insert into ZZPO00 select a11. AS MONTH_ID, a13. AS CATEGORY_ID, sum(a11.) AS WJXBFS1 from a11, a12, a13, a14 where a11. = a12. and a12. = a13. and a11. = a14. and a14. in (2006) group by a11., a13.
create table ZZPO00 (
MONTH_ID LONG,
CATEGORY_ID BYTE,
WJXBFS1 DOUBLE)
insert into ZZPO00
select a11. AS MONTH_ID,
a13. AS CATEGORY_ID,
sum(a11.) AS WJXBFS1
from a11,
a12,
a13,
a14
where a11. = a12. and
a12. = a13. and
a11. = a14.
and a14. in (2006)
group by a11.,
a13.
create table ZZMB01 (
CATEGORY_ID BYTE,
WJXBFS1 LONG)
insert into ZZMB01
select pc11. AS CATEGORY_ID,
max(pc11.) AS WJXBFS1
from pc11
group by pc11.select distinct pa11. AS CATEGORY_ID, a13. AS CATEGORY_DESC, pa11. AS WJXBFS1 from pa11, pa12, a13 where pa11. = pa12. and pa11. = pa12. and pa11. = a13. drop table ZZPO00
select distinct a11. AS PBTNAME from a11, a12 where a11. = a12. and a12. in (2006)
create table ZZTHC02008VPO000 ( MONTH_ID LONG, CATEGORY_ID BYTE, WJXBFS1 DOUBLE)
insert into ZZTHC02008VPO000 select a11. AS MONTH_ID, a13. AS CATEGORY_ID, sum(a11.) AS WJXBFS1 from a11, a12, a13, a14 where a11. = a12. and a12. = a13. and a11. = a14. and a14. in (2006) group by a11., a13. insert into ZZTHC02008VPO000 select a11. AS MONTH_ID, a13. AS CATEGORY_ID, sum(a11.) AS WJXBFS1 from a11, a12, a13, a14 where a11. = a12. and a12. = a13. and a11. = a14. and a14. in (2006) group by a11., a13. insert into ZZTHC02008VPO000 select a11. AS MONTH_ID, a13. AS CATEGORY_ID, sum(a11.) AS WJXBFS1 from a11, a12, a13, a14 where a11. = a12. and a12. = a13. and a11. = a14. and a14. in (2006) group by a11., a13. insert into ZZTHC02008VPO000 select a11. AS MONTH_ID, a13. AS CATEGORY_ID, sum(a11.) AS WJXBFS1 from a11, a12, a13, a14 where a11. = a12. and a12. = a13. and a11. = a14. and a14. in (2006) group by a11., a13. create table ZZTHC02008VMB001 ( CATEGORY_ID BYTE, WJXBFS1 LONG) insert into ZZTHC02008VMB001 select pc11. AS CATEGORY_ID, max(pc11.) AS WJXBFS1 from pc11 group by pc11.
select distinct pa11. AS CATEGORY_ID, a13. AS CATEGORY_DESC, pa11. AS WJXBFS1 from pa11, pa12, a13 where pa11. = pa12. and pa11. = pa12. and pa11. = a13. drop table ZZTHC02008VPO000 drop table ZZTHC02008VMB001