Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL Query Help - Something like Pivot

Posted on 2011-03-17
3
Medium Priority
?
277 Views
Last Modified: 2012-05-11
Team,

Need your help.

I have a table with some data on it. Please find attached a sample look of the table.

 Sample File
What i really want to do is, %  of escalated cases by team.

Escalation % per team =  Number of Escalations for the day / Number of cases handled for the day.

I cannot run pivot queries in my SQL as it doesnt support.

requesting your help to find the desired result in a query.

Thanks,
David
0
Comment
Question by:davidi1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 35156685
select Team
, count(*) total_cases
, sum(case when Status = 'Escalation' then 1 else 0 end) escalations
, cast( sum(case when Status = 'Escalation' then 1 else 0 end) as decimal(20,2)) /  count(*) perc_esc
from yourtable
group by team
0
 
LVL 2

Author Comment

by:davidi1
ID: 35156877
AngelIII - Thank you.., but am looking for per day per team percentage.., sorry if my question was confusing.
0
 
LVL 2

Author Comment

by:davidi1
ID: 35156901
Perfect. I made the changes with dates. Thanks again for your help
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question