Any better way to compare concatenated substrings?

GGL
Bronze 5
Bronze 5

Hi folks,

I have addresses like this:
123 Sample Street
456 Example Road

and some like this:
123 Sample St
456 Example Rd

To clarify, there are multiple entries with the same addresses but different โ€œendingsโ€.

I plan to clean them up at some point but for now Iโ€™m taking the first two substrings so I can compare them in a filter, like โ€œ123 Sampleโ€ and โ€œ456 Exampleโ€

I was just wondering if there might be a more straightforward way of doing it than as used below (whic seems to work fine):

    LINKTOFILTEREDVIEW( "History View" , 
   
   CONCATENATE( 
      INDEX(
         SPLIT( [Street], " " ),
         1
      ),
      " ",
      INDEX(
         SPLIT( [Street], " " ),
         2
      )
   )

   = 

   CONCATENATE( 
      INDEX(
         SPLIT( [_THISROW].[Street], " " ),
         1
      ),
      " ",
      INDEX(
         SPLIT( [_THISROW].[Street], " " ),
         2
      )
   )
)
1 3 191
3 REPLIES 3

Steve
Platinum 4
Platinum 4

AppSheet is no good dealing with this type of situation. No matter what you try with what AppSheet can do, youโ€™ll be frustratedโ€“there are simply waaaaayyyy too many ways the same street address can be expressed that confound the limited text processing capabilities of AppSheet.

Were I in your position, and I was using a Google Sheet as my data source (or maybe Excel-I donโ€™t know if Excel has the function), I would consider adding another column to the sheet with a spreadsheet formula that uses REGEXREPLACE() to attempt to produce a value with some degree of cleanup. It wouldnโ€™t be trivial, and would be very error-prone.

See also:
https://support.google.com/docs/answer/3098245

Thank you for your reply Steve.

And just wondering: Is the double CONCATENATE formula Iโ€™ve used a reasonable approach to retrieving a subset of substrings from a string, in this case the first two substrings of an address? Just curious whether thereโ€™s a simpler way.

Yes, your expression will in fact compare the first two words from the two columns.

Top Labels in this Space