Forum Discussion

klu31415's avatar
klu31415
Frequent Visitor
8 years ago

Dynamic Text Classification of Email Subject Lines using an additional Classification Table

I'm looking for a way to classify and return the value in another table based on whether the value in [table2](column1) is contained in the values of [table1](column1). In one table I'd have the subject line of each email and in the other, I would have the subject classifier that I'd expect to be contained in the subject line. I hope the below makes sense from a logic perspective. 

 

Logic

If [table1][subject] CONTAINS [table2](classifier)

THEN return [table2](classifier) in [table1](subject_classifier)

 

I've tried a few different variants of SWITCH + SEARCH statements and have been unable to figure out a way to return the actual classifier from table2 the most I've been able to do is hardcode in the expected text value output. The expected logic would allow classifications of email subjects to grow dynamically based on the data fed into table2 without the need to keep updating the hardcoded text strings. 

 

 

 

 

 

 

 

 

2 Replies

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

    How shall multiple matches be handled? (Create new row for each match or concatenate them in one cell with delimters)

    Is it correct that you want partial matches as well (so "apple" shall be returned for "pineapple") or just exact matches for the full word?

    • klu31415's avatar
      klu31415
      Frequent Visitor

      I would likely create separate DAX calculations for each of the subject_classifiers. So if I'm looking for a server name I'd look to that column in table2 but if I'm looking for another detail it would be held in a different column. So for my use case, I'd specifically want exact matches but I can see how partial matches would be helpful for other users. 

       

      Any help on this would be great!