tag:blogger.com,1999:blog-496084106724185073.post5076020584372705339..comments2023-01-25T03:16:06.420+13:00Comments on TechFilth: Calculate a median on a group in SSRSshanehttp://www.blogger.com/profile/07565638370666265398noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-496084106724185073.post-21047060408279175492013-01-20T10:43:52.133+13:002013-01-20T10:43:52.133+13:00Here it is 2013 and this is one of the very few ar...Here it is 2013 and this is one of the very few articles out there that explain this. Thanks so much!<br /><br />My only comment is that if mod 2 = 0 then that means it is an even number of objects correct? If so I think the logic is reversed on the IIF statement.<br /><br />I have this working on SSRS 2008 r2 with a hidden details group and corresponding hidden tablix row.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-496084106724185073.post-39104695424055145952010-09-16T19:01:53.478+12:002010-09-16T19:01:53.478+12:00Take a look at http://blogs.msdn.com/b/robertbruck...Take a look at http://blogs.msdn.com/b/robertbruckner/archive/2008/07/20/using-group-variables-in-reporting-services-2008-for-custom-aggregation.aspx<br /><br />I used this article and that one to get it to work in SSRS 2008, as I had the issue of the array not being cleared either, therefore I added the code I needed in this article to my custom code and called it in the Group where I had called the GetMedian() function.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-496084106724185073.post-13454768787143218212010-07-26T19:48:23.235+12:002010-07-26T19:48:23.235+12:00Great work only had to change array value to pick ...Great work only had to change array value to pick when there is oner rec<br /><br />'sort it & calculate it<br />arraySize = UBound(MedianArray)<br />If arraySize = 1 Then<br />CalculateMedian = CStr( MedianArray(<b> 1 </b>) )<br />Exit FunctionAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-496084106724185073.post-59490254231253618992009-05-27T23:12:10.914+12:002009-05-27T23:12:10.914+12:00it won't work in SSRS2008 when the fields are hidd...it won't work in SSRS2008 when the fields are hidden because hidden fields are not evaluated any more in SSRS2008, otherwise it should work.<br /><br />Reg.<br /><br />AlexAlexhttp://www.google.denoreply@blogger.comtag:blogger.com,1999:blog-496084106724185073.post-39611720460020110052008-10-09T14:03:00.000+13:002008-10-09T14:03:00.000+13:00No worries, glad to help :) It took a couple of da...No worries, glad to help :) <BR/>It took a couple of days of screwing around and a couple of hacks to get it to work, but to my knowledge this is still the only way to do it in this situation. Just remember, i haven't tested this is SSRS2008 yet.shanehttps://www.blogger.com/profile/07565638370666265398noreply@blogger.comtag:blogger.com,1999:blog-496084106724185073.post-85403304943129123882008-10-09T09:19:00.000+13:002008-10-09T09:19:00.000+13:00Oh my GOD - you are my new best friend! It worked...Oh my GOD - you are my new best friend! It worked GREAT! The only thing I had to do was tell it what to do if there is only 1 number. Thank you so much for posting this.Anonymousnoreply@blogger.com