Clay Icon

How to Extract Country from Location Column in a Table

Β·
Β·

Hi, this is probably a dumb question but how do I pull just the "Country" from the location column of a table?

  • Avatar of Clay Team
    Clay Team
    APP
    Β·
    Β·

    Hey hey! Can you drop the URL for your table here? (if applicable) 🫢 Don't worry, only admins will be able to open your table πŸ˜‰

  • Avatar of Clay Team
    Clay Team
    APP
    Β·
    Β·

    Hey Daniel, thanks for reaching out! taking a look at your setup

  • Avatar of Clay Team
    Clay Team
    APP
    Β·
    Β·

    Using conditional formulas could work for this but it, unfortunately, can't infer if it's in fact a country or not, it will only return the available results that are stored in that cell. For example, some may only mention the city or state and that's what it will return, if the country is present then it will return it.

  • Avatar of Clay Team
    Clay Team
    APP
    Β·
    Β·

    Perhaps using chatGPT may be the best way to infer and achieve this more accurately. Hope this helps!

  • Avatar of Daniel C.
    Daniel C.
    Β·
    Β·

    Yeah, I think I've used conditional formulas in the past for this but I just don't remember how to go about it.

  • Avatar of Clay Team
    Clay Team
    APP
    Β·
    Β·

    Yep, as mentioned, the formula generator doesn't have context or can't infer every country on its own so if you try to do that you'll have to specify what it returns based on the input which could be tedious.For example, some rows only have "San Francisco" or another city but doesn't mention the country. When you prompt the formula generator you'll have to specify that if it says "San Francisco" then return "United States" or "US", and will have to do this for every city that is formatted this way.Hence, chatGPT will be easier to get around that issue since it already has the context, all you need is to prompt it and provide the input.

  • Avatar of Daniel C.
    Daniel C.
    Β·
    Β·

    Ah, ok - well - thank you for helping

  • Avatar of Daniel C.
    Daniel C.
    Β·
    Β·

    and clarifying there.

  • Avatar of Daniel C.
    Daniel C.
    Β·
    Β·

    I'll try Chat GPT