我需要在我的行組中顯示2015年下的實線。 在屬性中,我輸入了我的表達式=IIF(Fields!YearNum.Value=2015,"Solid",Nothing)
但是由於有些月份沒有值,因此該行被打亂。 如何在沒有值的情況下顯示組中的實線?
什麼是解決這個問題的方法?
這裏是T-SQL爲表矩陣
SELECT CAST(B.YearNum as varchar(10))+ ' Submitted' as Type,
1 as OrderNum,
ISNULL(COUNT(ControlNo),0) Count,
b.YearNum, b.MonthNum, b.MonthName
FROM tblCalendar b
LEFT JOIN ClearanceReportMetrics a ON b.MonthNum = MONTH(a.EffectiveDate) AND b.YearNum=YEAR(a.EffectiveDate)
AND CompanyLine = 'Argonaut Insurance Company' AND Underwriter <> 'Batcheller, Jerry'
WHERE YEAR(EffectiveDate) IN (2016, 2015)
GROUP BY b.YearNum, b.MonthNum,b.MonthName
UNION ALL
SELECT CAST(b.YearNum as varchar(10)) +' Quoted' as Type,
2 as OrderNum,
ISNULL(SUM(CASE WHEN QuotedPremium IS NOT NULL THEN 1 ELSE 0 END),0) as Count,
b.YearNum, b.MonthNum,b.MonthName
FROM tblCalendar b
LEFT JOIN ClearanceReportMetrics a ON b.MonthNum = MONTH(a.EffectiveDate) AND b.YearNum=YEAR(a.EffectiveDate)
AND CompanyLine = 'Argonaut Insurance Company' AND Underwriter <> 'Batcheller, Jerry'
WHERE YEAR(EffectiveDate) IN (2016, 2015) --AND CompanyLine = 'Plaza Insurance Company' AND Underwriter <> 'Batcheller, Jerry'
GROUP BY b.YearNum, b.MonthNum,b.MonthName
UNION ALL
SELECT CAST(b.YearNum as varchar(10)) +' Bound' as Type,
3 as OrderNum,
ISNULL(sum(case when TransactionType = 'Policy' then 1 ELSE 0 END),0) as Binds,
b.YearNum,
b.MonthNum,
b.MonthName
FROM tblCalendar b
LEFT JOIN ProductionReportMetrics a ON b.MonthNum = MONTH(a.EffectiveDate) and b.YearNum = YEAR(a.EffectiveDate) --Coming from Production Report, NOT from Clearance!!!!!!!!!!!
AND CompanyLine = 'Argonaut Insurance Company' AND Underwriter <> 'Batcheller, Jerry'
WHERE b.YearNum IN (2016, 2015)
GROUP BY b.YearNum,b.MonthNum,b.MonthName
UNION ALL
SELECT CAST(b.YearNum as varchar(10)) +' Declined' as Type,
4 as OrderNum,
ISNULL(SUM(CASE WHEN Status = 'Declined' THEN 1 ELSE 0 END),0) as Count,
b.YearNum, b.MonthNum,b.MonthName
FROM tblCalendar b
LEFT JOIN ClearanceReportMetrics a ON b.MonthNum = MONTH(a.EffectiveDate) AND b.YearNum=YEAR(a.EffectiveDate)
AND CompanyLine = 'Argonaut Insurance Company' AND Underwriter <> 'Batcheller, Jerry'
WHERE YEAR(EffectiveDate) IN (2016, 2015)
GROUP BY b.YearNum, b.MonthNum,b.MonthName
我從來沒有找到一個簡單的方法來做到這一點,運作良好。您可以使用IIf將0轉換爲空格,將其他任何內容轉換爲數字轉換爲文本,但是當您使用Excel時,您有時會失去添加內容的能力。如果這是一個標準模式,您可以根據它是一個偶數行來做出決定。您還可以在底部添加一個矩形框,底部只有一個實線,當年是2015年時可以看到。 – DaveX
我有任何機會只能做彩色圖案嗎?就像2016年提交的2行和2015年提交的會是一種顏色等等? – Oleg
爲什麼不將這些零值更改爲0? – scsimon