Forum Discussion

ChrisAZ's avatar
ChrisAZ
Icon for Helper V rankHelper V
1 year ago
Solved

Trying to Extract Town name

I am wanting to get the Town name out of each of these rows in this column, and not sure the best way to do it. For example, first seven would be WHITECOURT, the 8th would be HIGH PRAIRIE, the ones with (DEF Units:xxx) would wind up with just the Town name.

  • ChrisAZ's avatar
    ChrisAZ
    1 year ago

    Wound up using a reference table, but needed to use fuzzy logic in order to pull the most appropriate matches.

17 Replies

  • ChrisAZ what is the business logic to extract the name, in other words, if you hav toe do it manually what logic will you apply?

    • ChrisAZ's avatar
      ChrisAZ
      Icon for Helper V rankHelper V

      Not sure I understand the question? We need to extract the town name from this field as it comes in from an export and are hoping to add automation to that process.

  • Deku's avatar
    Deku
    Icon for Super User rankSuper User

    Do you have a list of known town names you can use as a reference?

    • ChrisAZ's avatar
      ChrisAZ
      Icon for Helper V rankHelper V

      I mean, no we do not have a table of them and the thought is that it could grow I suppose in time. But if a cross table would be useful and one of the only ways to do it, we could consider that.

  • ChrisAZ understood, but what defines the town name? How one will know what value is the town name in that text value of each row.

    • ChrisAZ's avatar
      ChrisAZ
      Icon for Helper V rankHelper V

      Great question, I guess I was hoping there would be a way to do it based on the Province identifier that follows them which is generally always AB or BC

  • ChrisAZ do you have a list of town names that can be used to extract the value or there is a position of the town name in the text (my original reply for the logic) 

    • ChrisAZ's avatar
      ChrisAZ
      Icon for Helper V rankHelper V

      No, but would it be best to Create a table of some kind that has the known town names?

  • ChrisAZ getting there, so is it safe to say any value before "AB" or "BC" is a town name?

    • ChrisAZ's avatar
      ChrisAZ
      Icon for Helper V rankHelper V

      Yes, although some are single words and some are double

  • ChrisAZ although based on the sample data that also might not work because some town names have spaces. In that case, it will be safer to have a list of town names and then use that asa  reference to extract the name. 

    • ChrisAZ's avatar
      ChrisAZ
      Icon for Helper V rankHelper V

      So I create a reference table that just has a Town name reference. Then how do I use that in this case?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ChrisAZ,

    Thanks for reaching out to the Microsoft fabric community forum.

     

    It looks like you want remove certain values from rows of a columns and is looking for the best way to do it. As parry2k and Deku both responded to your query, please go through their responses and mark the helpful reply as solution.

     

    I would also take a moment to thank parry2k and Deku, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

     

    If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

    Best Regards,
    Hammad.
    Community Support Team

     

    If this post helps then please mark it as a solution, so that other members find it more quickly.

    Thank you.

    • ChrisAZ's avatar
      ChrisAZ
      Icon for Helper V rankHelper V

      I was not able to get to a usable solution from this post. I had gone and reposted my question and got a solution there and marked on of those as a solution. Thanks!

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi ChrisAZ,

        Since you were able to solve your issue, can you please reply with the solution and mark it as solution so that other members can find the solution quickly.

         

        Best Regards,
        Hammad.
        Community Support Team