Tigerexcel
Active Member
- Joined
- Mar 6, 2020
- Messages
- 493
- Office Version
- 365
- 2019
- Platform
- Windows
Can you apply an existing query without having to go into the Advanced Editor and amend the "M" programming?
I'll illustrate with an example, the first table has a simple query applied to it:
let
Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Subject", type text}, {"Score", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Subject"}, {{"Count", each [Name]}}),
#"Extracted Values" = Table.TransformColumns(#"Grouped Rows", {"Count", each Text.Combine(List.Transform(_, Text.From), " "), type text})
in
#"Extracted Values"
I receive another table which is in columns H to J, I would like the same output as in columns E to F. I could do it by copying the above query and then manually editing the Table name to whatever the new table is called but I suspect there's a more efficient way of doing this.
I'll illustrate with an example, the first table has a simple query applied to it:
let
Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Subject", type text}, {"Score", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Subject"}, {{"Count", each [Name]}}),
#"Extracted Values" = Table.TransformColumns(#"Grouped Rows", {"Count", each Text.Combine(List.Transform(_, Text.From), " "), type text})
in
#"Extracted Values"
I receive another table which is in columns H to J, I would like the same output as in columns E to F. I could do it by copying the above query and then manually editing the Table name to whatever the new table is called but I suspect there's a more efficient way of doing this.
Book1 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | |||
1 | Name | Subject | Score | New table | ||||||||
2 | Jack | Maths | 84 | Subject | Count | Name | Subject | Score | ||||
3 | Fred | Chem | 73 | Maths | Jack Mary Eddie Jake | Ted | Maths | 20 | ||||
4 | Pete | English | 89 | Chem | Fred Sally Sara Noel | Ian | English | 30 | ||||
5 | Harry | French | 88 | English | Pete Don Joel | Ken | Maths | 40 | ||||
6 | Mary | Maths | 60 | French | Harry Ken Tom | Mary | English | 50 | ||||
7 | Sally | Chem | 62 | Bart | Maths | 60 | ||||||
8 | Don | English | 79 | Bert | English | 70 | ||||||
9 | Ken | French | 91 | Herb | Maths | 80 | ||||||
10 | Eddie | Maths | 70 | |||||||||
11 | Sara | Chem | 92 | |||||||||
12 | Joel | English | 75 | |||||||||
13 | Tom | French | 88 | |||||||||
14 | Jake | Maths | 94 | |||||||||
15 | Noel | Chem | 95 | |||||||||
Sheet1 |
Last edited: