将数据分组在Microsoft Access或Microsoft Excel中
这似乎应该很简单,但我正在努力寻找解决方案。
我有一张大表格,其中包含项目团队成员,每个项目中的每个团队成员一行。这是它的外观简化样本:
项目 | 角色 | 团队成员 |
---|---|---|
Alpha | 项目经理 | Will Will Will |
Alpha | 业务分析师 | John |
Alpha | 业务分析师 | Amy |
Alpha | 开发商 | Sally |
Alpha | 开发 | 人员Joe Alpha开发人员Joe |
Alpha | 开发人员 | Pete |
Beta Beta | 项目经理 | John |
Robert Beta Beta | 业务分析师 | Frank |
Frank Beta | 开发人员 | Beta开发人员Frank |
Beta | 开发人员 | Beta Beta Develaper Bruce |
如您所见,我们的项目通常每个角色都有多个团队成员,我正在尝试在每个角色的列下列出适当的名称,每个项目一行:
项目 | 项目经理 | 业务分析师 | 开发人员 |
---|---|---|---|
Alpha | Will | John Amy | Sally Joe Pete |
Beta | Robert | John | Frank Bruce |
在我尝试在MS Access中使用Crosstab查询时,我必须选择名字或姓氏;我找不到列出所有这些方法的方法。
当我尝试MS Excel中的枢轴表时,我可以将每个角色显示为列,但是名称仍然出现在第一列中,而不是根据团队成员的角色出现在列中。
MS Access或MS Excel中的解决方案可以满足我的需求。
谢谢你!
This seems like it should be really simple but I am struggling to find a solution.
I have a large table containing project team members by role, one row for each team member on each project. Here is a simplified sample of what it looks like:
Project | Role | Team Member |
---|---|---|
Alpha | Project Manager | Will |
Alpha | Business Analyst | John |
Alpha | Business Analyst | Amy |
Alpha | Developer | Sally |
Alpha | Developer | Joe |
Alpha | Developer | Pete |
Beta | Project Manager | Robert |
Beta | Business Analyst | John |
Beta | Developer | Frank |
Beta | Developer | Bruce |
As you can see, our projects often have multiple team members per role, and I'm trying list the appropriate names under a column for each role, one row per project:
Project | Project Manager | Business Analyst | Developer |
---|---|---|---|
Alpha | Will | John Amy | Sally Joe Pete |
Beta | Robert | John | Frank Bruce |
When I try to use a crosstab query in MS Access, I have to choose either the first or last name; I cannot find a way to list all of them.
When I try a pivot table in MS Excel, I can get each role to appear as a column, but the names still appear in the first column rather than within the column based on the team member's role.
A solution in either MS Access or MS Excel would meet my needs.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了在PQ中执行此操作,您必须
使用PQ,以使用PQ
data =>获取& transform =>从表/范围
或从表格中
home =>高级编辑器
应用步骤
窗口,为了更好地理解算法和步骤,如果您的原始表是来自另一个来源,则需要从PQ访问该源 - 有许多连接器可以代替下面的代码中的第一行,
To do this in PQ, you have to
To use PQ if your original table was in Excel
Data => Get&Transform => From Table/Range
orFrom within sheet
Home => Advanced Editor
Applied Steps
window, to better understand the algorithm and stepsIf your original table is from another source, you will need to access that source from PQ -- there are numerous connectors you can substitute for the first line in the code below
为了完整性,这里是一个访问解决方案:
问题(突出显示)是访问只能将1个摘要放在横牌的每个单元格内,但是有多个团队成员填补了一些角色(高光线)。为了解决这个问题,我们将Teammember重新计算为:
sally< br/gt; joe< br/gt; pete
幸运的是,这里已经有一个功能:
Microsoft
访问控件中的丰富文本格式仅适用于长文本格式。因此,首先将角色和团队成员转换为表中的长文本。不幸的是,GetList必须返回字符串,因此我们无法直接从使用GetList的查询中构建报告。取而代之的是,我们基于类似的查询来构建报告:
将适当的报告控件设置为RichText,然后替换报告(单击红色)记录源(确保其报告使用getList的查询更改的记录源。
参见 http://allenbrowne.com/ser-63.html 最终查询的联合查询(备忘录=长文本)
使用GetList计算的字段替换团队成员。
And for completeness here is an Access solution:
The problem (highlighted) is Access can only put 1 summary inside each cell of the cross-tab but there are multiple Team Members filling some roles (high-lighted). To get around this we recalculate TeamMember to be a rich text list like:
Sally<br/>Joe<br/>Pete
Fortunately there is already a function for doing this here:
Microsoft Access condense multiple lines in a table
The rich text format in access controls only works with the long text format. So start by converting Role and TeamMember to long text in the table. Unfortunately, GetList must return a string so we can't build the report directly from a query that uses GetList. Instead we build the report based on a similar query:
set the appropriate report controls to richtext then replace the reports(click on red) record source(make sure its reports record source that is changed) with the query that uses getlist.
see http://allenbrowne.com/ser-63.html for a another work around involving a union query (memo= long text)
For the final query replace Team Member with a calculated field using GetList.