2

I cannot find a way to calculate the median for multiple columns of data presented in a single report.

I've tried to do it directly in the SQL Server code with PERCENTILE_CONT but there are compatibility level issues (level 100 though I use SQL Server 2017).

My preferred method was to do it through Custom Code following the instructions in: mean, median, mode in SQL Server Reporting Services which works to calculate the ONE median in the report, not multiple.

Does anyone have an idea?

Charles B
  • 21
  • 2
  • Perhaps [this article](https://blogs.lessthandot.com/index.php/datamgmt/dbprogramming/it-s-hard-to-be/) will help. – BJones Jan 10 '20 at 20:25
  • Or [this post on SO](https://stackoverflow.com/questions/1342898/function-to-calculate-median-in-sql-server) – BJones Jan 10 '20 at 20:29
  • I tried the TSQL code but it doesn't work because the resulting median for the report I need depends on 1 parameter that can take multiple values so my tablix changes but the median stays the same... So now I use the VB code I mention in my question and just replicated it changing the name of the variables to use for multiple median: the problem is that it replaces empty cell by 0 and I would need it to skip those. Still some work to do... – Charles B Jan 15 '20 at 20:26

0 Answers0