のSQL Server 2016 /レポートデザイナーを回答:これは私が間違っている場合ので、私を修正してください下にこの質問を配置する権利タイトルであれば100%の棒グラフSQLはい/いいえ
わかりません。私はイエスの列(50/50あたり100%積み上げ棒グラフにこれを取得するために探しています
CleanAndTidy HandWash PPEStorage PipesAndFittings COSHH
No No No No No
No Yes Yes Yes Yes
Yes No No Yes Yes
Yes No Yes Yes Yes
Yes Yes No No Yes
Yes Yes No Yes No
Yes Yes Yes No No
Yes Yes Yes Yes No
Yes Yes Yes Yes Yes
:
SELECT [aField6] AS [CleanAndTidy],
[aField10] AS [HandWash],
[aField8] AS [PPEStorage],
[aField14] AS [PipesAndFittings],
[aField12] AS [COSHH]
FROM vAdvF_265
GROUP BY [aField6], [aField10], [aField8], [aField14], [aField12]
の答えとして出てくる:
私には、以下の持っています/ no)、SSRSでこれを使用すると、データをグラフに提供する正しい方法を見つけることができないようです。
私も試してみました:
私に与えSELECT [Type1], [Count] -- YES Count
FROM (
SELECT
SUM(CASE WHEN [aField6]='yes' THEN 1 ELSE 0 END) AS [CleanAndTidyYes],
SUM(CASE WHEN [aField10]='yes' THEN 1 ELSE 0 END) AS [HandWashYes],
SUM(CASE WHEN [aField8]='yes' THEN 1 ELSE 0 END) AS [PPEStorageYes],
SUM(CASE WHEN [aField14]='yes' THEN 1 ELSE 0 END) AS [PipesAndFittingsYes],
SUM(CASE WHEN [aField12]='yes' THEN 1 ELSE 0 END) AS [COSHHYes]
FROM vAdvF_265
) sums
UNPIVOT
([Count] FOR [Type1] IN
([CleanAndTidyYes], [HandWashYes], [PPEStorageYes], [PipesAndFittingsYes], [COSHHYes])
) AS unpivoted1
UNION
SELECT [Type], [Count] --NO Count
FROM (
SELECT
SUM(CASE WHEN [aField6]='no' THEN 1 ELSE 0 END) AS [CleanAndTidyNo],
SUM(CASE WHEN [aField10]='no' THEN 1 ELSE 0 END) AS [HandWashNo],
SUM(CASE WHEN [aField8]='no' THEN 1 ELSE 0 END) AS [PPEStorageNo],
SUM(CASE WHEN [aField14]='no' THEN 1 ELSE 0 END) AS [PipesAndFittingsNo],
SUM(CASE WHEN [aField12]='no' THEN 1 ELSE 0 END) AS [COSHHNo]
FROM vAdvF_265
) sums
UNPIVOT
([Count] FOR [Type] IN
([CleanAndTidyNo], [HandWashNo], [PPEStorageNo], [PipesAndFittingsNo], [COSHHNo])
) AS unpivoted1;
を:
Type1 Count
-------------------------------------------------------------------------------------------------------------------------------- -----------
CleanAndTidyNo 2
CleanAndTidyYes 18
COSHHNo 3
COSHHYes 17
HandWashNo 7
HandWashYes 13
PipesAndFittingsNo 2
PipesAndFittingsYes 18
PPEStorageNo 4
PPEStorageYes 16
秒1は私が後だカウントを与えるが、私はまだ100%にこれを取得するために苦労していますchart vs Yes/Noの各列の回答。
誰かが正しい方向に私を向けるのを助けることができますか、アドバイスや他の方法を提供できますか?