I created a report with average on group totals on [Length of Stay] column. In VS, it renders properly.
=Sum(Max(Fields!LengthOfStay.Value, "PTGroup"))/CountDistinct(Fields!UniqueID.Value)
When I upload the report on the reporting server, I'm getting this instead:
And when I export to EXCEL, this is what I get:
Any ideas why?
August 3, 2021 at 3:10 pm
Thanks for posting your issue and hopefully someone will answer soon.
This is an automated bump to increase visibility of your question.
August 3, 2021 at 5:35 pm
It looks like you're getting a divide by zero error. I usually wrap any division formulas in an IIF statement to account for when the denominator is zero. Perhaps sometimes your UniqueID field can have no values, so the Count = 0. Additionally, I think CountDistinct ignores NULLs, so if all your values were NULL that could also yield a 0 (I'm not positive about that last point though).
I figured it out just now after reading your response.
I was developing the report on my local machine. I changed the SPROC to include the UniqueID field however, I forgot to update the DEV server SPROC that's why it was getting that divide by zero error since it cannot count a non-existing field.
Thanks!
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply