简体   繁体   中英

Is there a way to exclude certain keywords from a regexp_match statement in Tableau?

I am trying edit the calculation field and pull in filenames that contain the string 'NDA.' However, filenames that contain 'STANDARD' also get pulled in error. Is there a way to do this in Tableau? I have tried the follow but it becomes too restrictive and the majority of files I'd expect to pull don't get pulled no more.

 IF  REGEXP_MATCH(UPPER([Name]),'_NDA|NDA_|_NDA_|NDA<>STANDARD')THEN "Nondisclosure Agreement"

You can try creating it as a separate IF statement:

IF REGEXP_MATCH(UPPER([Name]),'STANDARD') THEN "Whatever you want here"
ELSE IF  REGEXP_MATCH(UPPER([Name]),'_NDA|NDA_|_NDA_')THEN "Nondisclosure Agreement"

On an unrelated note, you should think about using Contains instead of Regexp_match , since its usally better from a performance point of view.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM