Results 1 to 1 of 1

Thread: PQ-search for data with just a few letters from a data table

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

    Cool PQ-search for data with just a few letters from a data table

    Country of the world Population Select Country Country of the world Population
    Albania
    2,877,797
    Belg Australia
    25499884
    Algeria
    43,851,044
    Aus Austria
    9006398
    Andorra
    77,265
    Bul Belgium
    11589623
    Angola
    32,866,272
    Bra Bhutan
    771608
    Antigua and Barbuda
    97,929
    Burk Brazil
    212559417
    Argentina
    45,195,774
    Moz Bulgaria
    6948445
    Armenia
    2,963,243
    Bh Burkina Faso
    20903273
    Australia
    25,499,884
    So Moldova
    4033963
    Austria
    9,006,398
    V Monaco
    39242
    Azerbaijan
    10,139,177
    Mo Mongolia
    3278290
    Bahamas
    393,244
    Montenegro
    628066
    Bahrain
    1,701,575
    Morocco
    36910560
    Bangladesh
    164,689,383
    Mozambique
    31255435
    Barbados
    287,375
    Solomon Islands
    686884
    Belarus
    9,449,323
    Somalia
    15893222
    Belgium
    11,589,623
    South Africa
    59308690
    Belize
    397,628
    South Korea
    51269185
    Benin
    12,123,200
    South Sudan
    11193725
    Bhutan
    771,608
    Vanuatu
    307145
    Bolivia
    11,673,021
    Venezuela
    28435940
    Bosnia and Herzegovina
    3,280,819
    Vietnam
    97338579
    Botswana
    2,351,627
    Brazil
    212,559,417
    Brunei
    437,479
    Bulgaria
    6,948,445
    Burkina Faso
    20,903,273
    Burundi
    11,890,784
    Côte d'Ivoire
    26,378,274
    Cabo Verde
    555,987

    source data is much bigger so see attachment

    Code:
    // Table1
    let
        Table2 = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        List = Table.AddColumn(Source, "List", each Table2[Select Country]),
        Exp = Table.ExpandListColumn(List, "List"),
        IF = Table.AddColumn(Exp, "Country", each if Text.StartsWith([Country of the world], [List]) then [Country of the world] else null),
        NullOut = Table.SelectRows(IF, each ([Country] <> null)),
        TSC = Table.SelectColumns(NullOut,{"Country of the world", "Population"}),
        SortA = Table.Sort(TSC,{{"Country of the world", Order.Ascending}}),
        TD = Table.Distinct(SortA, {"Country of the world"})
    in
        TD

    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    https://www.youtube.com/watch?v=jTmVtPHtiTg&lc=Ugy_RiNN_kAqUvZ8W994AaABAg
    https://www.youtube.com/watch?v=QjEWAJ3d-jw&lc=UgxJLVpwY8fIla7G-pN4AaABAg.9BLeCWVhxdG9wgNsaS3Lp1
    https://www.youtube.com/watch?v=QjEWAJ3d-jw&lc=UgxJLVpwY8fIla7G-pN4AaABAg.9BLeCWVhxdG9wgR1EPUkhw
    https://www.youtube.com/watch?v=QjEWAJ3d-jw&lc=UgxJLVpwY8fIla7G-pN4AaABAg.9BLeCWVhxdG9wgNe_XC-jK
    https://www.youtube.com/watch?v=QjEWAJ3d-jw&lc=UgxJLVpwY8fIla7G-pN4AaABAg.9BLeCWVhxdG9wgNPOdiDuv
    https://www.youtube.com/watch?v=QjEWAJ3d-jw&lc=UgxJLVpwY8fIla7G-pN4AaABAg.9BLeCWVhxdG9wgN7AC7wAc
    https://www.youtube.com/watch?v=bs-urI_o8jo&lc=UgyBACXgNY4j_cHgH5J4AaABAg.9oTkVdzfqfm 9wlhQrYJP3M
    https://www.youtube.com/watch?v=bs-urI_o8jo&lc=UgxYgiEZuS9I3xkjJv54AaABAg
    https://www.youtube.com/watch?v=DVFFApHzYVk&lc=Ugyi578yhj9zShmhuPl4AaABAg
    https://www.youtube.com/watch?v=GqzeFYWjTxI&lc=UgxvxlnuTRWiV6MUZB14AaABAg
    https://www.youtube.com/watch?v=_8i1fVEi5WY&lc=Ugz0ptwE5J-2CpX4Lzh4AaABAg
    https://www.youtube.com/watch?v=0ltJS7uHfK4&lc=UgxoHAw8RwR7VmyVBUt4AaABAg. 9C-br0lEl8V9xI0_6pCaR9
    https://www.youtube.com/watch?v=0ltJS7uHfK4&lc=Ugz5DDCMqmHLeEjUU8t4AaABAg. 9bl7m03Onql9xI-ar3Z0ME
    https://www.youtube.com/watch?v=0ltJS7uHfK4&lc=UgxYnpd9leriPmc8rPd4AaABAg. 9gdrYDocLIm9xI-2ZpVF-q
    https://www.youtube.com/watch?v=0ltJS7uHfK4&lc=UgyjoPLjNeIAOMVH_u94AaABAg. 9id_Q3FO8Lp9xHyeYSuv1I
    https://www.reddit.com/r/windowsxp/comments/pexq9q/comment/k81ybvj/?utm_source=reddit&utm_medium=web2x&context=3
    https://www.youtube.com/watch?v=bs-urI_o8jo&lc=UgxYgiEZuS9I3xkjJv54AaABAg
    https://www.youtube.com/watch?v=bs-urI_o8jo&lc=UgyBACXgNY4j_cHgH5J4AaABAg.9oTkVdzfqfm 9wlhQrYJP3M
    ttps://www.youtube.com/watch?v=LP9fz2DCMBE
    https://www.youtube.com/watch?v=LP9fz2DCMBE&lc=UgzbPgJUMCztIOQDym14AaABAg
    https://www.youtube.com/watch?v=LP9fz2DCMBE&lc=UgzbPgJUMCztIOQDym14AaABAg. 9wdo_rWgxSH9wdpcYqrvp8
    ttps://www.youtube.com/watch?v=bFxnXH4-L1A
    https://www.youtube.com/watch?v=bFxnXH4-L1A&lc=UgxuODisjo6cvom7O-B4AaABAg.9w_AeS3JiK09wdi2XviwLG
    https://www.youtube.com/watch?v=bFxnXH4-L1A&lc=UgxBU39bTptFznDC1PJ4AaABAg
    ttps://www.youtube.com/watch?v=GqzeFYWjTxI
    https://www.youtube.com/watch?v=GqzeFYWjTxI&lc=UgwJnJDJ5JT8hFvibt14AaABAg
    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Last edited by DocAElstein; 11-30-2023 at 03:04 PM.
    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. Append Table data to another table
    By jeremiah_j2k in forum Excel Help
    Replies: 4
    Last Post: 08-10-2017, 09:12 PM
  2. search for data and delete rows containing it
    By RickStewart in forum Excel Help
    Replies: 2
    Last Post: 02-24-2014, 09:12 PM
  3. Use SUMIFS on pivot table data
    By malta1 in forum Excel Help
    Replies: 1
    Last Post: 02-18-2014, 10:55 AM
  4. Transpose A Column Of Data In To A Table
    By gunjan.nasit in forum Excel Help
    Replies: 4
    Last Post: 05-20-2013, 12:33 AM
  5. Upload Excel Data to SQL Table
    By littleiitin in forum Excel and VBA Tips and Tricks
    Replies: 3
    Last Post: 08-22-2012, 11:02 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
  •