Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Switch Statement Returning NaN

$
0
0

Hello,

I hope I can get some help with this.I am working on a report where they need to see the percentage of EMS calls with a response time of 7 mins (420 seconds) or less as well as the average response times for EMS calls only, which look like the below examples:

29D-Traffic Accident, 17B-Falls/Back Inj, 13A-Diabetic Problem, 10C-Chest Pains.

all EMS calls are designated this way, with a number followed by A,B,C,D codes

Here is my code as of right now. I have been playing around with this for over a day now but have only had it displaying NaN or 00.00 as the results:

=(Count(switch(
Fields!problem.Value ="*A-*" and Fields!traveltime.Value <=420, 1,
Fields!problem.Value ="*B-*" and Fields!traveltime.Value <=420, 1,
Fields!problem.Value ="*C-*" and Fields!traveltime.Value <=420, 1,
Fields!problem.Value ="*D-*" and Fields!traveltime.Value <=420, 1))/
Count(switch(
Fields!problem.Value ="*A-*", 1,
Fields!problem.Value ="*B-*", 1,
Fields!problem.Value ="*C-*", 1,
Fields!problem.Value ="*D-*", 1)) * 100)

Is there an easier way to go about this? Should I consider rewriting the DBA's stored procedure used for this?

Any help would be appreciated greatly!

- Robert J.



Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>