Hello guys,
I am trying to generate a report with 3 columns to give out results which have NULLs on certain cells. I realized that the rows with NULLs were not being displayed. I am trying to play with the VLDB to perform a LEFT OUTER JOIN. But the SQL only has JOIN between each table. How do I make MSTR perform a Left outer join.
Thank you so much!!
Herez the code incase you need to refer
select distinct a13.InvoiceDate InvoiceDate,
a18.TenantCompanyId TenantCompanyId,
a18.TenantCompanyDesc TenantCompanyDesc,
a19.TenantRepCompanyId TenantRepCompanyId,
a19.TenantRepCompanyDesc TenantRepCompanyDesc,
a11.BuildingId PROPERTYID,
a11.BuildingDesc PropertyDesc,
a11.BuildingAddress1 PropertyAddress1,
a11.BuildingCity PropertyCity,
a11.BuildingAddress2 PropertyAddress2,
a11.BuildingPhone PropertyPhone,
a11.BuildingState PropertyState,
a11.BuildingZip PropertyZip,
a16.LandLordRepId LandLordRepId,
a17.LandlordRepDesc LandlordRepDesc,
a17.LandlordRepCompanyId LandlordRepCompanyId,
a17.LandlordRepCompanyDesc LandlordRepCompanyDesc,
a12.RepresentationId RepresentationId,
a112.RepresentationDesc RepresentationDesc,
a12.ProductTypeId ProductTypeId,
a111.ProductTypeDesc ProductTypeDesc,
a12.LeaseTypeId LeaseTypeId,
a110.LeaseTypeDesc LeaseTypeDesc,
a16.DealSize DealSize,
a16.DealSizeUnit DealSizeUnit
from LU_BUILDING a11
join LU_DEAL a12
on (a11.DealId = a12.DealId)
join LU_INVOICE a13
on (a11.DealId = a13.DealId)
join LU_INVOICE_CTI_DATA a14
on (a13.InvoiceId = a14.InvoiceId and
a13.TransactionTypeId = a14.TransactionTypeId)
join FACT_DEAL a16
on (a11.DealId = a16.DealId and
a12.CustomerId = a16.CustomerId)
join LU_LANDLORD_REP a17
on (a11.DealId = a17.DealId and
a16.LandLordRepId = a17.LandLordRepId)
join LU_TENANT a18
on (a11.DealId = a18.DealId and
a16.TenantId = a18.TenantId)
join LU_TENANT_REP a19
on (a11.DealId = a19.DealId)
join LU_LEASE_TYPE a110
on (a12.LeaseTypeId = a110.LeaseTypeId)
join LU_PRODUCT_TYPE a111
on (a12.ProductTypeId = a111.ProductTypeId)
join LU_REPRESENTATION a112
on (a12.RepresentationId = a112.RepresentationId)
where (a13.InvoiceDate between CONVERT(datetime, '2004-01-01 00:00:00', 120) and CONVERT(datetime, '2004-04-02 00:00:00', 120)
and a12.LeaseTypeId in (1, 4, 5, 6, 7, 9, 10, 12)
and a12.DealClassificationId in (3, 4))
I am trying to generate a report with 3 columns to give out results which have NULLs on certain cells. I realized that the rows with NULLs were not being displayed. I am trying to play with the VLDB to perform a LEFT OUTER JOIN. But the SQL only has JOIN between each table. How do I make MSTR perform a Left outer join.
Thank you so much!!
Herez the code incase you need to refer
select distinct a13.InvoiceDate InvoiceDate,
a18.TenantCompanyId TenantCompanyId,
a18.TenantCompanyDesc TenantCompanyDesc,
a19.TenantRepCompanyId TenantRepCompanyId,
a19.TenantRepCompanyDesc TenantRepCompanyDesc,
a11.BuildingId PROPERTYID,
a11.BuildingDesc PropertyDesc,
a11.BuildingAddress1 PropertyAddress1,
a11.BuildingCity PropertyCity,
a11.BuildingAddress2 PropertyAddress2,
a11.BuildingPhone PropertyPhone,
a11.BuildingState PropertyState,
a11.BuildingZip PropertyZip,
a16.LandLordRepId LandLordRepId,
a17.LandlordRepDesc LandlordRepDesc,
a17.LandlordRepCompanyId LandlordRepCompanyId,
a17.LandlordRepCompanyDesc LandlordRepCompanyDesc,
a12.RepresentationId RepresentationId,
a112.RepresentationDesc RepresentationDesc,
a12.ProductTypeId ProductTypeId,
a111.ProductTypeDesc ProductTypeDesc,
a12.LeaseTypeId LeaseTypeId,
a110.LeaseTypeDesc LeaseTypeDesc,
a16.DealSize DealSize,
a16.DealSizeUnit DealSizeUnit
from LU_BUILDING a11
join LU_DEAL a12
on (a11.DealId = a12.DealId)
join LU_INVOICE a13
on (a11.DealId = a13.DealId)
join LU_INVOICE_CTI_DATA a14
on (a13.InvoiceId = a14.InvoiceId and
a13.TransactionTypeId = a14.TransactionTypeId)
join FACT_DEAL a16
on (a11.DealId = a16.DealId and
a12.CustomerId = a16.CustomerId)
join LU_LANDLORD_REP a17
on (a11.DealId = a17.DealId and
a16.LandLordRepId = a17.LandLordRepId)
join LU_TENANT a18
on (a11.DealId = a18.DealId and
a16.TenantId = a18.TenantId)
join LU_TENANT_REP a19
on (a11.DealId = a19.DealId)
join LU_LEASE_TYPE a110
on (a12.LeaseTypeId = a110.LeaseTypeId)
join LU_PRODUCT_TYPE a111
on (a12.ProductTypeId = a111.ProductTypeId)
join LU_REPRESENTATION a112
on (a12.RepresentationId = a112.RepresentationId)
where (a13.InvoiceDate between CONVERT(datetime, '2004-01-01 00:00:00', 120) and CONVERT(datetime, '2004-04-02 00:00:00', 120)
and a12.LeaseTypeId in (1, 4, 5, 6, 7, 9, 10, 12)
and a12.DealClassificationId in (3, 4))