Crosstab Query - Multiple Value Responses

B

Blondee

I've created a crosstab from a table with data laid out like this:
Group Section Title
A One John - Manager
A One Joe - Analyst
A Two Jane - Director
B Three Sue - Director
B One Bill - Manager
C Two Bob - Analyst
C Two Tom - Director
C Three Jim - President
D One Linda - Analyst
D Two Lucy - Manager

I'd like to end up with a cross tab like this (you may have to use your
imagination on layout since couldn't paste a picture) basically trying to get
multiple items to display in the value field.
Group One Two Three
A John - Manager
Joe - Analyst Jane - Director
B Bill - Manager
Sue - Director
C Bob - Analyst
Tom - Director
Jim - President
D Linda - Analyst Lucy - Manager

In my data above, I have two people in Group A and Section One.
I'm able to get the first item to appear using First, but can't get all of
them to appear. Is this possible?
Thanks for any assistance.
 
K

KARL DEWEY

Try this --
TRANSFORM First(TableA.[Title]) AS FirstOfTitle
SELECT TableA.[Group], [Group] & [Title] AS Expr1
FROM TableA
GROUP BY TableA.[Group], [Group] & [Title]
PIVOT TableA.[Section] IN("One", "Two", "Three");
 
B

Blondee

Thanks - I'll give it a try.

KARL DEWEY said:
Try this --
TRANSFORM First(TableA.[Title]) AS FirstOfTitle
SELECT TableA.[Group], [Group] & [Title] AS Expr1
FROM TableA
GROUP BY TableA.[Group], [Group] & [Title]
PIVOT TableA.[Section] IN("One", "Two", "Three");

--
Build a little, test a little.


Blondee said:
I've created a crosstab from a table with data laid out like this:
Group Section Title
A One John - Manager
A One Joe - Analyst
A Two Jane - Director
B Three Sue - Director
B One Bill - Manager
C Two Bob - Analyst
C Two Tom - Director
C Three Jim - President
D One Linda - Analyst
D Two Lucy - Manager

I'd like to end up with a cross tab like this (you may have to use your
imagination on layout since couldn't paste a picture) basically trying to get
multiple items to display in the value field.
Group One Two Three
A John - Manager
Joe - Analyst Jane - Director
B Bill - Manager
Sue - Director
C Bob - Analyst
Tom - Director
Jim - President
D Linda - Analyst Lucy - Manager

In my data above, I have two people in Group A and Section One.
I'm able to get the first item to appear using First, but can't get all of
them to appear. Is this possible?
Thanks for any assistance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top