May 6, 2013 at 8:32 am
I'm attempting to add field DrAmt based on field TranType. So when TranType = "INT" then add the value in DrAmt. Here is my statement:
=iif(Fields!TrantypeID.Value = "INT",SUM(Fields!DrAmt),0)
When I run the report I receive this error:
[rsAggregateOfInvalidExpressionDataType] The Value expression for the textrun ‘textbox76.Paragraphs[0].TextRuns[0]’ uses an aggregate function with an expression that returned a data type not valid for the aggregate function
Any help would be appreciated.
Thanks.
May 6, 2013 at 10:31 am
I think there's an error in your expression. Are you missing the .Value? (Bolded below)
=iif(Fields!TrantypeID.Value = "INT",SUM(Fields!DrAmt.Value),0)
May 6, 2013 at 10:38 am
Oh yeah that would help. Thanks, but the expression does not return the correct value just zero. I know there there data it should be calculating. Any ideas??
May 6, 2013 at 10:49 am
Looking at your dataset, what values are in the tranTypeID?
Is there actually a value called 'INT'?
May 6, 2013 at 10:58 am
Yes the vaules are INT, DEP, WHT
May 6, 2013 at 11:00 am
I think this will help.
Try wrapping the sum outside the iif
=SUM(iif(Fields!TrantypeID.Value = "INT",Fields!DrAmt,0))
May 6, 2013 at 11:06 am
Still zero amount.
May 6, 2013 at 11:28 am
Weird, its gotta be something silly.
Can you post a small sample of your dataset.
It seems fishy that the field your looking is named TranTypeID.Value, but your comparing it to Text value of 'INT'
May 6, 2013 at 12:21 pm
Here is an example of the data:
TranTypeID DrAmt CrAmt
CHK 0.00 13.37
CHK 0.00 22.50
ACHO 0.00 10.12
WD 0.00 35.00
CHK 0.00 125.00
CHK 0.00 60.23
DEP 25.00 0.00
INT 42.30 0.00
CHK 0.00 85.30
CHK 0.00 100.00
INT 200.00 0.00
May 6, 2013 at 1:04 pm
Are you grouping by Something else? Feels like something is missing.
Check the attached test Report1, on a row by row basis, the expression is reflecting the amt correctly, so Not sure what the issue is.
May 6, 2013 at 1:32 pm
I did get it to work. I was grouping them like you said. Thanks for your help!!
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply