Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Need help with OLAP views

Posted on 2005-04-26
4
Medium Priority
?
194 Views
Last Modified: 2012-05-05
Hi,

In response to a question I had posted in the ASP section, one of the experts had suggested that I use an OLAP view to get the data in the format I wanted it. The link to this question is as below. Can anyone help?

http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_21402306.html

Thanks,
A.

0
Comment
Question by:arunatata
  • 2
4 Comments
 
LVL 11

Expert Comment

by:Jokra_the_Barbarian
ID: 13870765
You cannot have more than 500 points for any one question. You will have to close the previous question or reward points for it if you want to keep this one open.
0
 
LVL 28

Expert Comment

by:rafrancisco
ID: 13870861
Try this link on how to TRANSFORM your table.

http://www.sqlteam.com/item.asp?ItemID=2955
0
 

Author Comment

by:arunatata
ID: 13871799
Unfortunately I am not able to figure this one out - can you be more specific to my code?

Thanks,
A.
0
 
LVL 28

Accepted Solution

by:
rafrancisco earned 2000 total points
ID: 13882273
Try this:

SELECT [TimeRange], MIN(CASE WHEN [TesterName] = 'Tester A' THEN UserGroup ELSE '' END) AS [Tester A],
                    MIN(CASE WHEN [TesterName] = 'Tester B' THEN UserGroup ELSE '' END) AS [Tester B],
                    MIN(CASE WHEN [TesterName] = 'Tester C' THEN UserGroup ELSE '' END) AS [Tester C]
FROM (
SELECT TesterName, '7AMto8AM' AS [TimeRange], UserID + '/' + GroupID AS UserGroup
FROM YourTable
WHERE [7AMto8AM] = 'Y'
UNION ALL
SELECT TesterName, '8AMto9AM' AS [TimeRange], UserID + '/' + GroupID AS UserGroup
FROM YourTable
WHERE [8AMto9AM] = 'Y'
UNION ALL
SELECT TesterName, '9AMto10AM' AS [TimeRange], UserID + '/' + GroupID AS UserGroup
FROM YourTable
WHERE [9AMto10AM] = 'Y') A
GROUP BY [TimeRange]
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

572 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