Forum Discussion

maryg's avatar
maryg
Frequent Visitor
2 years ago

Help to make substring extract more efficient - unrelated tables

Hey everyone!  I am using some DAX code to extract a substring from a narrative field.  I am using a calculated column and my tables are unrelated and cannot be related.  What I am using works, but it takes DAYS, and it is about 31,000 rows.  I am thinking a calculated table may be better, but I cant figure out how to do that, while extracting a substring.  Any thoughts are appreciated!  I have googled for a long time and cant seem to get quite what i need.  Here is what I am currently doing:  

 

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    maryg What does your data look like? Can you provide sample data as text? Also, that code is only going to find the word that is last in the alphabet soooo...

  • maryg's avatar
    maryg
    Frequent Visitor

    Hi - thanks for the response!  Yes, I have gone back and forth ith firstnonblank and this maxx filter and i get back the same results, but always looking for better options!  Here is a sample of what my data looks like:

     

    August52024 (table in which i need to add the extracted data in a column - named NPNextract in my code):

    ~30,000 rows, ~20 columns

    the important field here is Case Narrative - this contains free form text and in most instances will have an NPN (which is a 5-8 digit identifier)

     

    RTS_IVL_06_25_2024 (table contains NPN columns i am trying to extract from other table)

    ~95,000 rows, ~20 columns

    NPN is NOT distinct

     

    August52024
    Case IDMember NameCase NarrativeNPNextract (this is what I am trying to get)
    123John Doethis person is assigned to 012345, blah blah012345
    234Jane Smiththis person is talked to 123456, blah blahno match
    456Mary Jonesthis person is mentioned 234567, blah blah234567
        
    RTS_IVL_06_25_2024
    NPNBroker Name 
    012345Joe White 
    234567Sally Black 

    sorry if this is clunky, first time poster!

    • maryg's avatar
      maryg
      Frequent Visitor

      Hi - was just checking in to see if my data sample helped?