SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSRS Warning - rsAggregateOfInvalidExpressionDataType


SSRS Warning - rsAggregateOfInvalidExpressionDataType

Author
Message
poo83
poo83
Grasshopper
Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)

Group: General Forum Members
Points: 20 Visits: 12
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 .
Rob Taylor
Rob Taylor
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3872 Visits: 1616
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
poo83
poo83
Grasshopper
Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)

Group: General Forum Members
Points: 20 Visits: 12
Thanks Rob. The link is really helpful.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search