Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SSRS Warning - rsAggregateOfInvalidExpressionDataType Expand / Collapse
Author
Message
Posted Friday, August 1, 2014 9:19 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, November 11, 2014 10:54 AM
Points: 2, Visits: 10
I am trying to get percentage field with the following code -
=SWITCH(Parameters!Type.Value = 1, IIF(Sum(Fields!LYTD_TransactionsOnline.Value) <> 0,
Code.DivXbyY(Sum(Fields!TYTD_TransactionsOnline.Value) - Sum(Fields!LYTD_TransactionsOnline.Value),
Sum(Fields!LYTD_TransactionsOnline.Value)), 1)
,Parameters!Type.Value = 2, IIF(Sum(Fields!LYTD_TransactionsOnSite.Value) <> 0,
Code.DivXbyY(Sum(Fields!TYTD_TransactionsOnSite.Value) - Sum(Fields!LYTD_TransactionsOnSite.Value),
Sum(Fields!LYTD_TransactionsOnSite.Value)), 1)
,Parameters!Type.Value = 3, IIF(Sum(Fields!LYTD_Transactions.Value) <> 0,
Code.DivXbyY(Sum(Fields!TYTD_Transactions.Value) - Sum(Fields!LYTD_Transactions.Value), Sum(Fields!LYTD_Transactions.Value)), 1))


This expresssion is giving a warning when the report is run.

Warning - [rsAggregateOfInvalidExpressionDataType] The Value expression for the textrun ‘Textbox56.Paragraphs[0].TextRuns[0]’ uses an aggregate function with an expression that returned a data type not valid for the aggregate function.


I don't know why it is giving a warning like this.
i am using ssrs 2012. Also i dont get what is Code.DivXbyY . I tried to search online but no luck. This code is written by someone else and i am just making changes here.

Can someone please help me on this. Thanks .
Post #1598732
Posted Monday, August 11, 2014 12:38 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 11:21 AM
Points: 1,234, Visits: 1,271
Someone has probably written a little bit of code to do division that handles zeros. To see the code in your SSRS report take a look at this link:
http://msdn.microsoft.com/en-us/library/ms156028(v=sql.110).aspx

From the error message, it sounds like you're trying to do a SUM() or AVG() (or some such aggregate) on a string.

HTH,
Rob
Post #1602021
Posted Wednesday, September 3, 2014 9:04 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, November 11, 2014 10:54 AM
Points: 2, Visits: 10
Thanks Rob. The link is really helpful.
Post #1610093
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse