在矩陣控件中,我按'大小'對列進行分組,然後按'顏色'進行分組。所得到的表看起來像這樣:在矩陣控制中反轉嵌套列組的標題行
我需要反轉的標題行,所以表看起來像這樣:
從子組的值應該上述顯示來自父組的相應值。
在矩陣控件中,我按'大小'對列進行分組,然後按'顏色'進行分組。所得到的表看起來像這樣:在矩陣控制中反轉嵌套列組的標題行
我需要反轉的標題行,所以表看起來像這樣:
從子組的值應該上述顯示來自父組的相應值。
也許通過將父組合併爲大小和顏色的組合,但只顯示顏色,然後按子組/子組顯示顏色。
更新:
好了,我創建了一個小數據集,我不知道這些數據不喜歡你找回東西,但也許它可以刺激你如何處理的一些數據的其他想法SQL來幫助您在報告中獲取所需內容。
首先,我剛剛創建了一堆SELECT ... UNION ALL語句,但是在一些玩弄之後,我仍然無法獲得任何接近所需視覺輸出/分組的東西。因此,這裏是我用什麼:
with CTE (Color, Size, CSGroup, Amt) As (
select 'Red' As color, 'Small' as size, 'RedSmall' as CSGroup, 1 as Amt union all
select 'Red' As color, 'Small' as size, 'RedSmall' as CSGroup, 1 as Amt union all
select 'Red' As color, 'Medium' as size,'RedMedium' as CSGroup, 1 as Amt union all
select 'Red' As color, 'Medium' as size, 'RedMedium' as CSGroup, 1 as Amt union all
select 'Red' As color, 'Medium' as size, 'RedMedium' as CSGroup, 1 as Amt union all
select 'Red' As color, 'Small' as size, 'RedSmall' as CSGroup, 1 as Amt union all
select 'Yellow' As color, 'Small' as size, 'YellowSmall' as CSGroup ,1 as Amt union all
select 'Yellow' As color, 'Small' as size, 'YellowSmall' as CSGroup ,1 as Amt union all
select 'Yellow' As color, 'Large' as size, 'YellowLarge' as CSGroup ,1 as Amt union all
select 'Yellow' As color, 'Large' as size, 'YellowLarge' as CSGroup ,1 as Amt union all
select 'Yellow' As color, 'Large' as size, 'YellowLarge' as CSGroup ,1 as Amt union all
select 'Yellow' As color, 'Medium' as size, 'YellowMedium' as CSGroup ,1 as Amt union all
select 'Yellow' As color, 'Medium' as size, 'YellowMedium' as CSGroup ,1 as Amt union all
select 'Blue' As color, 'Medium' as size, 'BlueMedium' as CSGroup, 1 as Amt union all
select 'Blue' As color, 'Medium' as size, 'BlueMedium' as CSGroup, 1 as Amt union all
select 'Blue' As color, 'Medium' as size, 'BlueMedium' as CSGroup, 1 as Amt union all
select 'Blue' As color, 'Small' as size, 'BlueSmall' as CSGroup, 1 as Amt union all
select 'Blue' As color, 'Large' as size, 'BlueLarge' as CSGroup, 1 as Amt union all
select 'Blue' As color, 'Large' as size, 'BlueLarge' as CSGroup, 1 as Amt union all
select 'Green' As color, 'Medium' as size, 'GreenMedium' as CSGroup, 1 as Amt union all
select 'Green' As color, 'Medium' as size, 'GreenMedium' as CSGroup, 1 as Amt union all
select 'Green' As color, 'Large' as size, 'GreenLarge' as CSGroup, 1 as Amt union all
select 'Green' As color, 'Large' as size, 'GreenLarge' as CSGroup, 1 as Amt union all
select 'Green' As color, 'Large' as size, 'GreenLarge' as CSGroup, 1 as Amt union all
select 'Green' As color, 'Small' as size, 'GreenSmall' as CSGroup, 1 as Amt union all
select 'Green' As color, 'Small' as size, 'GreenSmall' as CSGroup, 1 as Amt)
Select Color, Size, SUM(Amt) As Amount From CTE group by Color, Size
可以忽略CSGroup
我最終沒有使用它。
因此,它給了我在數據集中所需的「外觀」。
予藥物了矩陣和上尺寸分組&顏色(=Fields!size.Value & Fields!color.Value
)
我然後插入一組,並在尺寸(=Fields!size.Value
)
分組在「頂部」列分組我有=Fields!color.Value
在第二列分組我有=First(Fields!Size.Value)
在數據文本框我有=Sum(Fields!Amount.Value)
然後,右鍵單擊第二列分組並選中「隱藏重複項」複選框。然後我在下拉菜單中選擇了Dataset1
。
我無法做的唯一的事情就是讓尺寸居中,因爲我無法合併文本框。
這將從「尺寸」組拆分合並的單元格。按大小+顏色分組會產生8個不同的單列組(在提供的示例中)。在(Size)上添加一個子組不會將它們合併在一起... – Andy 2010-10-11 13:41:44
更新後的答案會在一些亂七八糟的東西后面出現。 – 2010-10-11 16:16:27
是的......合併這些細胞是我無法做到的......我想這聽起來比實際上更簡單:) – Andy 2010-10-12 12:07:41