Skip to main content
Question

Extract characters

  • May 14, 2019
  • 0 replies
  • 458 views

I am trying to extract the first two or three characters before "WN" in a text field.  Left(Trim([Incident Number]),"WN") works until you have something that has another "N" or "W".  Example text is: DTWWN11111111 or DEWNWN000000000.  Text can also be CCWN001111111.

I know this might be simple, but I can't figure it out.  Any help will be greatly appreciated.
This topic has been closed for replies.

  • Quickbase Alumni
  • May 14, 2019
You could get away using a Part function - which will split your text into parts based on a matching delimiter

So like
Part(string,1,"WN")
Will return whats in front of the first WN

Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base

This tested OK for me

var text ReplaceWNwithPipe = SearchAndReplace([data field],"WN","|");

Left($ReplaceWNwithPipe,"|")