Can't reference a Group Field in Footer SUM expression
Hiiiiiiiiiiiiiiiiiiiiiiiii, I created a report with 3 parameters. I am unable to reference a Group field in Footer textbox expression. My expression is : =IIF(Runningvalue(Fields!Txdate.Value,CountDistinct,"TransactionType")=1, 0.0,Sum(Fields!Commission.Value)) The following error i am getting: [rsFieldReference] The Value expression for the text box TXDate refers to the field Txdate. Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Can anyone help on dis? Thanks, Visu
May 17th, 2012 3:16pm

Hi There What is "TransactionType" ? Is it your group name and you are trying to use this in tablix footer or group footer row If you are trying to use inside the tablix footer row you would not be able to use that as it is out of the scope of group instead you can use your dataset name instead of TransactionType If you have any question please let me know. Many Thanks Syed Qazafi Anjum Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful. .
Free Windows Admin Tool Kit Click here and download it now
May 17th, 2012 7:19pm

Hello, Follow the below troubleshooting steps. It may help you. http://msdn.microsoft.com/en-us/library/cc879331.aspx
May 18th, 2012 3:38am

Hi Syed Qazafi Anjum, Thanks for reply. TransactionType is my group name , I used dataset name instead of group name but i am getting the following error: [rsInvalidScopeInTablix] The Value expression for the text box Textbox3 has a scope parameter that is not valid for RunningValue, RowNumber or Previous. The scope parameter must be set to a string constant that is equal to the name of a containing group within the Tablix Tablix1. My expression is : =IIF(Runningvalue(Fields!Txdate.Value,CountDistinct,"AgentCommission")=1, 0.0,Sum(Fields!Commission.Value)) Here "AgentCommission" is my dataset name. Thanks, Visu
Free Windows Admin Tool Kit Click here and download it now
May 18th, 2012 6:03am

Hi There By the way where are you executing this expression. You have to make sure that dataset name must be exactly same as it is being defined. Dataset name are case sensitive in the scope statement as I have test your expression in my environment and it is working fine. I am also assuming that AgentCommission is the dataset link to the tablix in which you are executing the expression Many Thanks Syed Qazafi Anjum Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.
May 18th, 2012 6:24am

Hi Visu, Before we go further, I would like to explain that: RunningValue function cannot be used in page footer/header.When a field is referenced in an aggregate expression in page footer/header, the scope in the aggregate function should be a dataset.In page footer/header, an expression can only reference one report item. In this issue, the solution or workaround depends on your specific scenario: Scenario 1: There is no page break between each instance of the TransactionType group, and the Sum(Fields!Commission.Value) is an aggregate value of the dataset In this scenario, you can change the expression to: =IIf(CountDistinct(Fields!Txdate.Value,"DataSet1")=1, 0.0, sum(Fields!Commission.Value,"DataSet1")) Scenario 2: There is no page break between each instance of the TransactionType group, and the Sum(Fields!Commission.Value) is an aggregate value of the specified group In this scenario, it cannot be achieved in Reporting Services currently. To work around this issue, you can add page break between each instance of the TransactionType group and then refer to the solution in Scenario 3. Scenario 3: There is page break between each instance of the TransactionType group, and the Sum(Fields!Commission.Value) is an aggregate value of the specified group, i.e. the current page In this scenario, we can reference report item instead of field. Note that one expression can only reference one report item. So, you can refer to the steps below: Drag a textbox to the page footer, type 0.0 in the textbox, set the visibility of the textbox by using the expression: =IIF(CountDistinct(ReportItems!Txdate.Value)=1,false,true)Drag another textbox to the page footer, type =Sum(ReportItems!Commission.Value) in the textbox, set the visibility of the textbox by using the expression: =IIF(CountDistinct(ReportItems!Txdate.Value)=1,true,false) Scenario 4: There is page break between each instance of the TransactionType group, and the Sum(Fields!Commission.Value) is an aggregate value of the dataset In this scenario, you can use the expression below: =IIf(CountDistinct(ReportItems!Txdate.Value)=1, 0.0, sum(Fields!Commission.Value,"DataSet1")) If you have any questions, please feel free to let me know. Regards, Mike Yin
Free Windows Admin Tool Kit Click here and download it now
May 19th, 2012 6:09am

Hi Visu, Before we go further, I would like to explain that: RunningValue function cannot be used in page footer/header.When a field is referenced in an aggregate expression in page footer/header, the scope in the aggregate function should be a dataset.In page footer/header, an expression can only reference one report item. In this issue, the solution or workaround depends on your specific scenario: Scenario 1: There is no page break between each instance of the TransactionType group, and the Sum(Fields!Commission.Value) is an aggregate value of the dataset In this scenario, you can change the expression to: =IIf(CountDistinct(Fields!Txdate.Value,"DataSet1")=1, 0.0, sum(Fields!Commission.Value,"DataSet1")) Scenario 2: There is no page break between each instance of the TransactionType group, and the Sum(Fields!Commission.Value) is an aggregate value of the specified group In this scenario, it cannot be achieved in Reporting Services currently. To work around this issue, you can add page break between each instance of the TransactionType group and then refer to the solution in Scenario 3. Scenario 3: There is page break between each instance of the TransactionType group, and the Sum(Fields!Commission.Value) is an aggregate value of the specified group, i.e. the current page In this scenario, we can reference report item instead of field. Note that one expression can only reference one report item. So, you can refer to the steps below: Drag a textbox to the page footer, type 0.0 in the textbox, set the visibility of the textbox by using the expression: =IIF(CountDistinct(ReportItems!Txdate.Value)=1,false,true)Drag another textbox to the page footer, type =Sum(ReportItems!Commission.Value) in the textbox, set the visibility of the textbox by using the expression: =IIF(CountDistinct(ReportItems!Txdate.Value)=1,true,false) Scenario 4: There is page break between each instance of the TransactionType group, and the Sum(Fields!Commission.Value) is an aggregate value of the dataset In this scenario, you can use the expression below: =IIf(CountDistinct(ReportItems!Txdate.Value)=1, 0.0, sum(Fields!Commission.Value,"DataSet1")) If you have any questions, please feel free to let me know. Regards, Mike Yin
May 19th, 2012 6:26am

Hi Visu, Before we go further, I would like to explain that: RunningValue function cannot be used in page footer/header.When a field is referenced in an aggregate expression in page footer/header, the scope in the aggregate function should be a dataset.In page footer/header, an expression can only reference one report item. In this issue, the solution or workaround depends on your specific scenario: Scenario 1: There is no page break between each instance of the TransactionType group, and the Sum(Fields!Commission.Value) is an aggregate value of the dataset In this scenario, you can change the expression to: =IIf(CountDistinct(Fields!Txdate.Value,"DataSet1")=1, 0.0, sum(Fields!Commission.Value,"DataSet1")) Scenario 2: There is no page break between each instance of the TransactionType group, and the Sum(Fields!Commission.Value) is an aggregate value of the specified group In this scenario, it cannot be achieved in Reporting Services currently. To work around this issue, you can add page break between each instance of the TransactionType group and then refer to the solution in Scenario 3. Scenario 3: There is page break between each instance of the TransactionType group, and the Sum(Fields!Commission.Value) is an aggregate value of the specified group, i.e. the current page In this scenario, we can reference report item instead of field. Note that one expression can only reference one report item. So, you can refer to the steps below: Drag a textbox to the page footer, type 0.0 in the textbox, set the visibility of the textbox by using the expression: =IIF(CountDistinct(ReportItems!Txdate.Value)=1,false,true)Drag another textbox to the page footer, type =Sum(ReportItems!Commission.Value) in the textbox, set the visibility of the textbox by using the expression: =IIF(CountDistinct(ReportItems!Txdate.Value)=1,true,false) Scenario 4: There is page break between each instance of the TransactionType group, and the Sum(Fields!Commission.Value) is an aggregate value of the dataset In this scenario, you can use the expression below: =IIf(CountDistinct(ReportItems!Txdate.Value)=1, 0.0, sum(Fields!Commission.Value,"DataSet1")) If you have any questions, please feel free to let me know. Regards, Mike Yin
Free Windows Admin Tool Kit Click here and download it now
May 19th, 2012 6:26am

Hiiiiiiiii Mike Yin, I am using expression in data section of Matrix Report and i added a column group to my matrix report(i.e.TransactionType). My expression is : =IIF(Runningvalue(Fields!Txdate.Value,CountDistinct,"TransactionType")=1, 0.0,Sum(Fields!Commission.Value)) I am getting following error: [rsFieldReference] The Value expression for the text box TXDate refers to the field Txdate. Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Thanks, Visu
May 20th, 2012 10:55am

Hi Syed, I am using expression in data section of Matrix Report and i added a column group to my matrix report(i.e.TransactionType). My expression is : =IIF(Runningvalue(Fields!Txdate.Value,CountDistinct,"TransactionType")=1, 0.0,Sum(Fields!Commission.Value)) I am getting following error: [rsFieldReference] The Value expression for the text box TXDate refers to the field Txdate. Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. & If i use dataset(i.e.AgentCommission) instead of groupname(i.e. TransactionType) in the expression, the following error i am getting: [rsInvalidScopeInTablix] The Value expression for the text box Commission has a scope parameter that is not valid for RunningValue, RowNumber or Previous. The scope parameter must be set to a string constant that is equal to the name of a containing group within the Tablix Tablix1.
Free Windows Admin Tool Kit Click here and download it now
May 20th, 2012 11:02am

Hi there I have used matrix but I could not produce your error normally in my test environment. The only times it will appear if you have created a column by right click on your column group and insert column outside group and try to put expression inside that column. In that case you will not be able to access your column group in that column I am putting screenshot for your help If you have any questions please do ask Many thanks Syed Qazafi Anjum Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful =IIF(Runningvalue(Fields!activity.Value,CountDistinct,"StatusName")=1, 0.0,Sum(Fields!TRANS_AMT.Value))
May 21st, 2012 12:47am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics