


The values returned for M01 are inaccurate because it ignores the indirect relationships between tables:

SQL before fix
select pa13.YEAR_ID YEAR_ID, avg((a11.TOT_COST - a12.TOT_COST)) WJXBFS1 from QTR_CATEGORY_SLS a11 cross join CITY_CTR_SLS a12 join T176SPLD7OP000 pa13 on (a11.QUARTER_ID = pa13.QUARTER_ID) group by pa13.YEAR_ID ...
In the new fix, an intermediate table made from using other tables in the dataset with common attributes is used to join the two fact tables. This mimics the CSI that is generated for In-Memory datasets. As a result, more accurate data will be returned.
With the example above, there is no common attribute between "QTR_CATEGORY_SLS" AND "CITY_MNTH_SLS". However, they can be connected by common attributes in the "LU_MONTH" and "CITY_MNTH_SLS" tables. The new SQL shows how an intermediate table is created by joining these tables:
<?xml version='1.0'?>
create table T7RTQ22AEOP000 nologging as
select distinct a12.CUST_CITY_ID CUST_CITY_ID,
a13.CALL_CTR_ID CALL_CTR_ID,
a11.QUARTER_ID QUARTER_ID
from LU_MONTH a11
join CITY_MNTH_SLS a12
on (a11.MONTH_ID = a12.MONTH_ID)
join CITY_CTR_SLS a13
on (a12.CUST_CITY_ID = a13.CUST_CITY_ID)
...
select pa14.YEAR_ID YEAR_ID,
avg((a11.TOT_COST - a13.TOT_COST)) WJXBFS1
from QTR_CATEGORY_SLS a11
join T7RTQ22AEOP000 pa12
on (a11.QUARTER_ID = pa12.QUARTER_ID)
join CITY_CTR_SLS a13
on (pa12.CALL_CTR_ID = a13.CALL_CTR_ID and
pa12.CUST_CITY_ID = a13.CUST_CITY_ID)
join TCM8D230MOP001 pa14
on (a11.QUARTER_ID = pa14.QUARTER_ID)
group by pa14.YEAR_ID
...
|
<?xml version='1.0'?>
create table T7RTQ22AEOP000 nologging as
select distinct a12.CUST_CITY_ID CUST_CITY_ID,
a13.CALL_CTR_ID CALL_CTR_ID,
a11.QUARTER_ID QUARTER_ID
from LU_MONTH a11
join CITY_MNTH_SLS a12
on (a11.MONTH_ID = a12.MONTH_ID)
join CITY_CTR_SLS a13
on (a12.CUST_CITY_ID = a13.CUST_CITY_ID)
...
select pa14.YEAR_ID YEAR_ID,
avg((a11.TOT_COST - a13.TOT_COST)) WJXBFS1
from QTR_CATEGORY_SLS a11
join T7RTQ22AEOP000 pa12
on (a11.QUARTER_ID = pa12.QUARTER_ID)
join CITY_CTR_SLS a13
on (pa12.CALL_CTR_ID = a13.CALL_CTR_ID and
pa12.CUST_CITY_ID = a13.CUST_CITY_ID)
join TCM8D230MOP001 pa14
on (a11.QUARTER_ID = pa14.QUARTER_ID)
group by pa14.YEAR_ID
...
|
The correct data is now returned:

Strategy Internal Reference Number for this technical note is KB483561 and DE105518.