Results 1 to 1 of 1

Thread: PQ - Summary from template in single workbook

  1. #1
    Sir Moderator sandy666's Avatar
    Join Date
    May 2018
    Posts
    239
    Rep Power
    7

    Cool PQ - Summary from template in single workbook

    Assumption:
    • sheet destination for summary
    • existing template of the table (here: Table1)
    • template ID (whatever) contain formula: =RIGHT(CELL("filename",A$1),LEN(CELL("filename",A$ 1))-SEARCH("]",CELL("filename",A$1)))



    steps:
    • copy template sheet to the end of the sheets



    • rename tab of copied template to required name



    • fill template table on this new sheet



    • first time Load Query to the Summary tab



    • do the same for the next tabs then just Refresh summary table


    // Summary - name of query
    Code:
    let
        Source = Excel.CurrentWorkbook(),
        FilterTemplate = Table.SelectRows(Source, each ([Name] <> "Summary" and [Name] <> "Table1")),
        TSC = Table.SelectColumns(FilterTemplate,{"Content"}),
        Expand = Table.ExpandTableColumn(TSC, "Content", {"ID", "Name", "Company", "Country", "City", "Sales"}, {"ID", "Name", "Company", "Country", "City", "Sales"}),
        FilterNull = Table.Distinct(Table.SelectRows(Expand, each ([ID] <> null))),
        Type = Table.TransformColumnTypes(FilterNull,{{"ID", type text}, {"Name", type text}, {"Company", type text}, {"Country", type text}, {"City", type text}, {"Sales", Int64.Type}})
    in
        Type
    Note: file must be saved before use

    Example: s666-PQ-summary.xlsx
    Last edited by sandy666; 08-02-2020 at 08:28 AM.
    sandy
    I know you know but I forgot my Crystal Ball and don't know what you know also I may not remember what I did weeks, months or years ago so answer asap. Thinking doesn't hurt

Similar Threads

  1. Summary Of Maximum Rows Used Across Each Sheet In A Workbook
    By Excel Fox in forum Excel and VBA Tips and Tricks
    Replies: 9
    Last Post: 09-04-2015, 07:35 PM
  2. Replies: 9
    Last Post: 07-02-2013, 10:02 PM
  3. Replies: 4
    Last Post: 06-18-2013, 01:38 PM
  4. Replies: 1
    Last Post: 05-09-2013, 08:56 AM
  5. Replies: 2
    Last Post: 12-19-2012, 08:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •