+ Reply to Thread
Results 1 to 7 of 7

How to populate query [List]

Hybrid View

  1. #1
    Registered User
    Join Date
    08-08-2023
    Location
    Montreal, QC
    MS-Off Ver
    Office 365
    Posts
    4

    How to populate query [List]

    I am new to queries in Excel and can't seem to find another post with my issue, though I suspect I am not using the right terms.

    I have queried a data table, and certain columns in the query contain a list of 1-4 different classifiers. When editing my query I can preview these lists, but in my Excel book I only have the text "[List]" for these entries.Screenshot 2023-08-08 155505.pngScreenshot 2023-08-08 161805.png
    Is there a way to have those lists populate, either as separate entries, or concatenated in the same cell?

    Thanks in advance for any guidance you can share!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,895

    Re: How to populate query [List]

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-08-2023
    Location
    Montreal, QC
    MS-Off Ver
    Office 365
    Posts
    4

    Re: How to populate query [List]

    Hello AliGW,

    Thank you for your response and welcoming me!

    My issue with attaching a sample workbook with 10-20 entries is that my query has 900 someodd entries, and I dont know how to limit entries in that way.

    The data is publicly available online, so I am not sure what needs to be desensitized.

    I would just like to pull this data table directly from the URL in the format it appears there (listed entries appear as wrapped text in cells) rather than a[List] entry that I cannot even expand.

    I am happy to comply with any forum rules in order to get guidance on my issue, but I may need some guidance to be able to comply properly. I appreciate your patience with my lack of experience.

    Thanks,
    Rob

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,895

    Re: How to populate query [List]

    If the data isn't sensitive, there is no need to desensitise it, but only you know this!

    Let's try another tack: wheere is the data to be found online: Post the URL wit TWO spaces added to it.

    How EXACTLY have you brought that data into Excel to arrive at the stage you are at in the screenshot (clear steps, please).

    We need something to work with, otherwise it's all just guesswork.

  5. #5
    Registered User
    Join Date
    08-08-2023
    Location
    Montreal, QC
    MS-Off Ver
    Office 365
    Posts
    4

    Re: How to populate query [List]

    The data is from the Canadian governments' public list of all cannabis licenses:
    canada.ca/en/health-canada/services/drugs-medication/cannabis/industry-licensees-applicants/licensed-cultivators-processors-sellers.html

    In order to pull the data as in my screenshot, I used the 'Get & Transform data - From Web' tool in office 365. I added the URL and followed through prompts without making any modifications.
    Screenshot 2023-08-09 101151.png

    Screenshot 2023-08-09 101217.png

    Screenshot 2023-08-09 101301.png

    I did try to make some modifications in a copied document to experiment, but I feel like I am going down the wrong path. I had landed on a support page with all the List. functions for modifying power queries.
    Screenshot 2023-08-09 100729.png

    Screenshot 2023-08-09 100447.png
    It may be that I did not understand the proper syntax to implement these functions in the query.

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,996

    Re: How to populate query [List]

    Something like this should work as long as there aren't any nested lists in there:

    let
        Source = Web.Page(Web.Contents("canada.ca/en/health-canada/services/drugs-medication/cannabis/industry-licensees-applicants/licensed-cultivators-processors-sellers.html")),
        Data0 = Source{0}[Data],
        #"Changed Type" = Table.TransformColumnTypes(Data0,{{"Licence holder", type text}, {"Province / territory", type text}, {"Licence(s)", type any}, {"Classes of cannabis the licence holder is authorized to sell to provincially/ territorially authorized distributors/retailers", type any}, {"Classes of cannabis the licence holder is authorized to sell to registered patients", type any}, {"Client Care phone numbers for registered patients", type text}, {"Date of initial licensing (year-month-day)", type text}}),
        Result = Table.TransformColumns(#"Changed Type", {}, each try Text.Combine(_, ", ") otherwise _)
    in
        Result
    Everyone who confuses correlation and causation ends up dead.

  7. #7
    Registered User
    Join Date
    08-08-2023
    Location
    Montreal, QC
    MS-Off Ver
    Office 365
    Posts
    4

    Re: How to populate query [List]

    Thank you so much! This worked for me!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 8
    Last Post: 10-21-2020, 03:02 AM
  2. Can I populate a ComboBox from a SQL query?
    By Izzii0x in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-20-2019, 10:27 AM
  3. Populate A Form Combobox With A SQL Query?
    By accell in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-09-2015, 03:28 PM
  4. [SOLVED] Auto Populate Order Form, based on qty's filled in Price list - Query
    By magpie10 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-11-2014, 02:08 AM
  5. Replies: 1
    Last Post: 11-05-2013, 12:40 AM
  6. [SOLVED] Loop through list, perform web query and save each query on its own page
    By anrichards22 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2012, 07:50 AM
  7. Populate worksheet by query
    By isofuncurves in forum Excel General
    Replies: 1
    Last Post: 07-12-2007, 10:51 PM

Tags for this Thread

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