I am running a report off a query that is using a LEFT OUTER JOIN to ensure that dates are included even if there is no data for the dates. (See the bottom of this post for the query).
I am displaying the data in a crosstab report, using the dates as columns. The ideal is that if there is no data for the date then each value in the column displays blank.
This is working. The problem is, if the crosstab has one or more blank columns, then a blank row with no header appears as well..
The attached image shows two crosstabs. The range "11 August to 17 August" has no empty dates, so subsequently there are no empty rows.
But the range "18 August to 21 August" happens to have empty dates. The columns are correctly empty, but there is one group row that has no header.
I can understand why this is so, but how can I make the blank row go away? My guess is that there's some filtering condition along the lines of "if VideoGroupName IS NOT NULL", but I can't seem to find a way to filter away nullness.
I am displaying the data in a crosstab report, using the dates as columns. The ideal is that if there is no data for the date then each value in the column displays blank.
This is working. The problem is, if the crosstab has one or more blank columns, then a blank row with no header appears as well..
The attached image shows two crosstabs. The range "11 August to 17 August" has no empty dates, so subsequently there are no empty rows.
But the range "18 August to 21 August" happens to have empty dates. The columns are correctly empty, but there is one group row that has no header.
I can understand why this is so, but how can I make the blank row go away? My guess is that there's some filtering condition along the lines of "if VideoGroupName IS NOT NULL", but I can't seem to find a way to filter away nullness.
select
date_range_all.
Date
,
values_in_range.VideoGroupName,
values_in_range.VideoGroupKey,
values_in_range.NumberOfPlayers,
values_in_range.AveragePlaysPerHour
from
(
select
date_dimension.
date
from
Date_Dimension
where
date_dimension.WeekStartingThuSeqNo
IN
(
select
distinct
Date_Dimension.WeekStartingThuSeqNo
from
Date_Dimension
where
Date_Dimension.
Date
>= @startDate
and
Date_Dimension.
Date
< @endDateExclusive
)
) date_range_all
left
outer
join
(
-- More query here
) values_in_range
on
date_range_all.
Date
= values_in_range.
Date