all groups > sql server reporting services > september 2005 >
Well, I finally got my first percentage on a Pie chart but when I went to use the same technique on a Matrix report with the Pie being created for each new row (Vice_President) then I started getting funny numbers. I think I have figured out that I need to use the IN SCOPE function but I am a little unsure how to write it..... Do I add it to the front of the first statement I wrote? Should I use an IIF? I am trying to get the percent calculation off a field called Reg_Hours (Data) and the grouping is done on a field called Vice_President (Rows). Project_Category (Columns) is the field displayed across the top. The dataset is called VP_Proj_Cat. This is what I have built thus far and I know my "True" statement is not working because it is returning the "False" portion....... =iif(InScope("Vice_President"), Sum(Fields!Reg_Hours.Value)/ Sum(Fields!Reg_Hours.Value, "VP_Proj_Cat"), (Fields!Reg_Hours.Value))
The scope defines how many rows are taken into account by the aggregate function. If the scope name is the dataset, then all rows of the dataset will be used. Inside a matrix, you usually would have matrix row and column groupings. These groupings represent scopes. For your case, it sounds like you want use the name of the matrix row grouping instead of the dataset name to determine percentages: Sum(Fields!Reg_Hours.Value) / Sum(Fields!Reg_Hours.Value, "MatrixRowGroupName") -- Robert This posting is provided "AS IS" with no warranties, and confers no rights. [quoted text, click to view] "anthonysjo" <anthonysjo@discussions.microsoft.com> wrote in message news:6B282809-A92E-4214-B51A-084AE802B15F@microsoft.com... > Well, I finally got my first percentage on a Pie chart but when I went to > use > the same technique on a Matrix report with the Pie being created for each > new > row (Vice_President) then I started getting funny numbers. I think I have > figured out that I need to use the IN SCOPE function but I am a little > unsure > how to write it..... > Do I add it to the front of the first statement I wrote? > Should I use an IIF? > > I am trying to get the percent calculation off a field called Reg_Hours > (Data) and the grouping is done on a field called Vice_President (Rows). > Project_Category (Columns) is the field displayed across the top. The > dataset is called VP_Proj_Cat. > > This is what I have built thus far and I know my "True" statement is not > working because it is returning the "False" portion....... > > =iif(InScope("Vice_President"), Sum(Fields!Reg_Hours.Value)/ > Sum(Fields!Reg_Hours.Value, "VP_Proj_Cat"), (Fields!Reg_Hours.Value)) >
I tried this FX: =Sum(Fields!Reg_Hours.Value)/Sum(Fields!Reg_Hours.Value, "Vice_President") Get this error: The expression for the chart ‘chart2’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a data set. Build complete -- 1 errors, 0 warnings Maybe I should have mentioned that the chart is embedded in the matrix. This is what I have defined for the matrix: Rows: Pie Chart (New Pie for each row) Data: Reg_Hours (Sum of hours for each pie spread across the Proj_Cat columns) Columns: Proj_Cat (Dynamic list of columns that contain the hours for each category) In the pie chart I have the following: Series Fields: Proj_Cat Data Fields: Reg_Hours Category Field: Nothing You have been a big help thus far.....hopefully I have given you enough information. [quoted text, click to view] "Robert Bruckner [MSFT]" wrote: > The scope defines how many rows are taken into account by the aggregate > function. If the scope name is the dataset, then all rows of the dataset > will be used. > Inside a matrix, you usually would have matrix row and column groupings. > These groupings represent scopes. For your case, it sounds like you want use > the name of the matrix row grouping instead of the dataset name to determine > percentages: > Sum(Fields!Reg_Hours.Value) / Sum(Fields!Reg_Hours.Value, > "MatrixRowGroupName") > > -- Robert > This posting is provided "AS IS" with no warranties, and confers no rights. > > > "anthonysjo" <anthonysjo@discussions.microsoft.com> wrote in message > news:6B282809-A92E-4214-B51A-084AE802B15F@microsoft.com... > > Well, I finally got my first percentage on a Pie chart but when I went to > > use > > the same technique on a Matrix report with the Pie being created for each > > new > > row (Vice_President) then I started getting funny numbers. I think I have > > figured out that I need to use the IN SCOPE function but I am a little > > unsure > > how to write it..... > > Do I add it to the front of the first statement I wrote? > > Should I use an IIF? > > > > I am trying to get the percent calculation off a field called Reg_Hours > > (Data) and the grouping is done on a field called Vice_President (Rows). > > Project_Category (Columns) is the field displayed across the top. The > > dataset is called VP_Proj_Cat. > > > > This is what I have built thus far and I know my "True" statement is not > > working because it is returning the "False" portion....... > > > > =iif(InScope("Vice_President"), Sum(Fields!Reg_Hours.Value)/ > > Sum(Fields!Reg_Hours.Value, "VP_Proj_Cat"), (Fields!Reg_Hours.Value)) > > > >
Assuming the reportitem name of your pie chart inside the matrix is "Chart1", please try the following expression for the datapoint labels: =Fields!Reg_Hours.Value / Sum(Fields!Reg_Hours.Value, "Chart1") -- Robert This posting is provided "AS IS" with no warranties, and confers no rights. [quoted text, click to view] "anthonysjo" <anthonysjo@discussions.microsoft.com> wrote in message news:FADEEE22-C7CF-4E0E-940F-988CBF0D298D@microsoft.com... >I tried this FX: > =Sum(Fields!Reg_Hours.Value)/Sum(Fields!Reg_Hours.Value, "Vice_President") > > Get this error: > > The expression for the chart 'chart2' has a scope parameter that is not > valid for an aggregate function. The scope parameter must be set to a > string > constant that is equal to either the name of a containing group, the name > of > a containing data region, or the name of a data set. > Build complete -- 1 errors, 0 warnings > > Maybe I should have mentioned that the chart is embedded in the matrix. > > This is what I have defined for the matrix: > Rows: Pie Chart (New Pie for each row) > Data: Reg_Hours (Sum of hours for each pie spread across the Proj_Cat > columns) > Columns: Proj_Cat (Dynamic list of columns that contain the hours for each > category) > > In the pie chart I have the following: > Series Fields: Proj_Cat > Data Fields: Reg_Hours > Category Field: Nothing > > You have been a big help thus far.....hopefully I have given you enough > information. > "Robert Bruckner [MSFT]" wrote: > >> The scope defines how many rows are taken into account by the aggregate >> function. If the scope name is the dataset, then all rows of the dataset >> will be used. >> Inside a matrix, you usually would have matrix row and column groupings. >> These groupings represent scopes. For your case, it sounds like you want >> use >> the name of the matrix row grouping instead of the dataset name to >> determine >> percentages: >> Sum(Fields!Reg_Hours.Value) / Sum(Fields!Reg_Hours.Value, >> "MatrixRowGroupName") >> >> -- Robert >> This posting is provided "AS IS" with no warranties, and confers no >> rights. >> >> >> "anthonysjo" <anthonysjo@discussions.microsoft.com> wrote in message >> news:6B282809-A92E-4214-B51A-084AE802B15F@microsoft.com... >> > Well, I finally got my first percentage on a Pie chart but when I went >> > to >> > use >> > the same technique on a Matrix report with the Pie being created for >> > each >> > new >> > row (Vice_President) then I started getting funny numbers. I think I >> > have >> > figured out that I need to use the IN SCOPE function but I am a little >> > unsure >> > how to write it..... >> > Do I add it to the front of the first statement I wrote? >> > Should I use an IIF? >> > >> > I am trying to get the percent calculation off a field called Reg_Hours >> > (Data) and the grouping is done on a field called Vice_President >> > (Rows). >> > Project_Category (Columns) is the field displayed across the top. The >> > dataset is called VP_Proj_Cat. >> > >> > This is what I have built thus far and I know my "True" statement is >> > not >> > working because it is returning the "False" portion....... >> > >> > =iif(InScope("Vice_President"), Sum(Fields!Reg_Hours.Value)/ >> > Sum(Fields!Reg_Hours.Value, "VP_Proj_Cat"), (Fields!Reg_Hours.Value)) >> > >> >> >>
The item name for this chart is "Chart2" If I put this in and run it I still get the same error. The expression for the chart ‘chart2’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a data set. Build complete -- 1 errors, 0 warnings Any additional thoughts on what is wrong? [quoted text, click to view] "Robert Bruckner [MSFT]" wrote: > Assuming the reportitem name of your pie chart inside the matrix is > "Chart1", please try the following expression for the datapoint labels: > =Fields!Reg_Hours.Value / Sum(Fields!Reg_Hours.Value, "Chart1") > > -- Robert > This posting is provided "AS IS" with no warranties, and confers no rights. > > "anthonysjo" <anthonysjo@discussions.microsoft.com> wrote in message > news:FADEEE22-C7CF-4E0E-940F-988CBF0D298D@microsoft.com... > >I tried this FX: > > =Sum(Fields!Reg_Hours.Value)/Sum(Fields!Reg_Hours.Value, "Vice_President") > > > > Get this error: > > > > The expression for the chart 'chart2' has a scope parameter that is not > > valid for an aggregate function. The scope parameter must be set to a > > string > > constant that is equal to either the name of a containing group, the name > > of > > a containing data region, or the name of a data set. > > Build complete -- 1 errors, 0 warnings > > > > Maybe I should have mentioned that the chart is embedded in the matrix. > > > > This is what I have defined for the matrix: > > Rows: Pie Chart (New Pie for each row) > > Data: Reg_Hours (Sum of hours for each pie spread across the Proj_Cat > > columns) > > Columns: Proj_Cat (Dynamic list of columns that contain the hours for each > > category) > > > > In the pie chart I have the following: > > Series Fields: Proj_Cat > > Data Fields: Reg_Hours > > Category Field: Nothing > > > > You have been a big help thus far.....hopefully I have given you enough > > information. > > "Robert Bruckner [MSFT]" wrote: > > > >> The scope defines how many rows are taken into account by the aggregate > >> function. If the scope name is the dataset, then all rows of the dataset > >> will be used. > >> Inside a matrix, you usually would have matrix row and column groupings. > >> These groupings represent scopes. For your case, it sounds like you want > >> use > >> the name of the matrix row grouping instead of the dataset name to > >> determine > >> percentages: > >> Sum(Fields!Reg_Hours.Value) / Sum(Fields!Reg_Hours.Value, > >> "MatrixRowGroupName") > >> > >> -- Robert > >> This posting is provided "AS IS" with no warranties, and confers no > >> rights. > >> > >> > >> "anthonysjo" <anthonysjo@discussions.microsoft.com> wrote in message > >> news:6B282809-A92E-4214-B51A-084AE802B15F@microsoft.com... > >> > Well, I finally got my first percentage on a Pie chart but when I went > >> > to > >> > use > >> > the same technique on a Matrix report with the Pie being created for > >> > each > >> > new > >> > row (Vice_President) then I started getting funny numbers. I think I > >> > have > >> > figured out that I need to use the IN SCOPE function but I am a little > >> > unsure > >> > how to write it..... > >> > Do I add it to the front of the first statement I wrote? > >> > Should I use an IIF? > >> > > >> > I am trying to get the percent calculation off a field called Reg_Hours > >> > (Data) and the grouping is done on a field called Vice_President > >> > (Rows). > >> > Project_Category (Columns) is the field displayed across the top. The > >> > dataset is called VP_Proj_Cat. > >> > > >> > This is what I have built thus far and I know my "True" statement is > >> > not > >> > working because it is returning the "False" portion....... > >> > > >> > =iif(InScope("Vice_President"), Sum(Fields!Reg_Hours.Value)/ > >> > Sum(Fields!Reg_Hours.Value, "VP_Proj_Cat"), (Fields!Reg_Hours.Value)) > >> > > >> > >> > >> > >
You had the formula right....I jsut missed the caps on chart1 which is case sensitive This worked: =Fields!Reg_Hours.Value / Sum(Fields!Reg_Hours.Value, "chart1") Thanks for all the help!!! [quoted text, click to view] "anthonysjo" wrote: > The item name for this chart is "Chart2" If I put this in and run it I still > get the same error. > > The expression for the chart ‘chart2’ has a scope parameter that is not > valid for an aggregate function. The scope parameter must be set to a string > constant that is equal to either the name of a containing group, the name of > a containing data region, or the name of a data set. > Build complete -- 1 errors, 0 warnings > > Any additional thoughts on what is wrong? > > "Robert Bruckner [MSFT]" wrote: > > > Assuming the reportitem name of your pie chart inside the matrix is > > "Chart1", please try the following expression for the datapoint labels: > > =Fields!Reg_Hours.Value / Sum(Fields!Reg_Hours.Value, "Chart1") > > > > -- Robert > > This posting is provided "AS IS" with no warranties, and confers no rights. > > > > "anthonysjo" <anthonysjo@discussions.microsoft.com> wrote in message > > news:FADEEE22-C7CF-4E0E-940F-988CBF0D298D@microsoft.com... > > >I tried this FX: > > > =Sum(Fields!Reg_Hours.Value)/Sum(Fields!Reg_Hours.Value, "Vice_President") > > > > > > Get this error: > > > > > > The expression for the chart 'chart2' has a scope parameter that is not > > > valid for an aggregate function. The scope parameter must be set to a > > > string > > > constant that is equal to either the name of a containing group, the name > > > of > > > a containing data region, or the name of a data set. > > > Build complete -- 1 errors, 0 warnings > > > > > > Maybe I should have mentioned that the chart is embedded in the matrix. > > > > > > This is what I have defined for the matrix: > > > Rows: Pie Chart (New Pie for each row) > > > Data: Reg_Hours (Sum of hours for each pie spread across the Proj_Cat > > > columns) > > > Columns: Proj_Cat (Dynamic list of columns that contain the hours for each > > > category) > > > > > > In the pie chart I have the following: > > > Series Fields: Proj_Cat > > > Data Fields: Reg_Hours > > > Category Field: Nothing > > > > > > You have been a big help thus far.....hopefully I have given you enough > > > information. > > > "Robert Bruckner [MSFT]" wrote: > > > > > >> The scope defines how many rows are taken into account by the aggregate > > >> function. If the scope name is the dataset, then all rows of the dataset > > >> will be used. > > >> Inside a matrix, you usually would have matrix row and column groupings. > > >> These groupings represent scopes. For your case, it sounds like you want > > >> use > > >> the name of the matrix row grouping instead of the dataset name to > > >> determine > > >> percentages: > > >> Sum(Fields!Reg_Hours.Value) / Sum(Fields!Reg_Hours.Value, > > >> "MatrixRowGroupName") > > >> > > >> -- Robert > > >> This posting is provided "AS IS" with no warranties, and confers no > > >> rights. > > >> > > >> > > >> "anthonysjo" <anthonysjo@discussions.microsoft.com> wrote in message > > >> news:6B282809-A92E-4214-B51A-084AE802B15F@microsoft.com... > > >> > Well, I finally got my first percentage on a Pie chart but when I went > > >> > to > > >> > use > > >> > the same technique on a Matrix report with the Pie being created for > > >> > each > > >> > new > > >> > row (Vice_President) then I started getting funny numbers. I think I > > >> > have > > >> > figured out that I need to use the IN SCOPE function but I am a little > > >> > unsure > > >> > how to write it..... > > >> > Do I add it to the front of the first statement I wrote? > > >> > Should I use an IIF? > > >> > > > >> > I am trying to get the percent calculation off a field called Reg_Hours > > >> > (Data) and the grouping is done on a field called Vice_President > > >> > (Rows). > > >> > Project_Category (Columns) is the field displayed across the top. The > > >> > dataset is called VP_Proj_Cat. > > >> > > > >> > This is what I have built thus far and I know my "True" statement is > > >> > not > > >> > working because it is returning the "False" portion....... > > >> > > > >> > =iif(InScope("Vice_President"), Sum(Fields!Reg_Hours.Value)/ > > >> > Sum(Fields!Reg_Hours.Value, "VP_Proj_Cat"), (Fields!Reg_Hours.Value)) > > >> > > > >> > > >> > > >> > > > >
Don't see what you're looking for? Try a search.
|
|
|