Results 1 to 6 of 6

Deleting a set of entries based on sum of entries in the set

Threaded View

  1. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Deleting a set of entries based on sum of entries in the set

    I have used Power Query, called Get and Transform Data in your version of Excel and found on the Data Tab.

    I loaded your table into the PQ editor. Data-->Get & Transform Data-->From Table or Range

    I then applied the following Mcode
    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type datetime}, {"Code", Int64.Type}, {"Amount", Int64.Type}}),
        #"Grouped Rows" = Table.Group(#"Changed Type", {"Code"}, {{"Data", each List.Sum([Amount]), type nullable number}})
    in
        #"Grouped Rows"
    I then made a duplicate of the original table in PQ and created a merge of each table to the other (a left outer join)

    Here is the Mcode for that next section

    let
        Source = Table.NestedJoin(Table1, {"Code"}, #"Table1 (2)", {"Code"}, "Table1 (2)", JoinKind.LeftOuter),
        #"Filtered Rows" = Table.SelectRows(Source, each ([Data] = 650)),
        #"Expanded Table1 (2)" = Table.ExpandTableColumn(#"Filtered Rows", "Table1 (2)", {"Amount"}, {"Amount"})
    in
        #"Expanded Table1 (2)"
    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Deleting a set of entries based on condition applied to the entire set
    By regn in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-31-2021, 03:37 PM
  2. Replies: 1
    Last Post: 11-27-2017, 08:50 PM
  3. Excel VBA: deleting entries based on date ranges
    By MattWardlow in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2017, 12:17 PM
  4. [SOLVED] Read entries-locate entries and print entries
    By akotronis in forum Excel General
    Replies: 4
    Last Post: 05-01-2012, 03:05 PM
  5. Finding and Deleting Rows based on Formula entries
    By BehrBrew in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-27-2012, 06:01 PM
  6. Auto-Generating Entries based on combined Entries
    By Ice Burn in forum Excel General
    Replies: 3
    Last Post: 09-12-2011, 05:52 AM
  7. deleting many entries
    By a2zedgifts in forum Excel General
    Replies: 0
    Last Post: 01-17-2005, 12:26 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1