• 0

# Formula in Calculation

## Question

hello, in a formula how do you write a CASE WHEN statement that tries to find text in a field that not equals it, but CONTAINS text ?

In a formula instead of finding something that is equal, I would like to find something in the field that CONTAINS the text, so not equal or greater or less but CONTAINS

When [@field1]='apples' then 'fruit'... How do i change the equal sign so that it finds a word in the text but not the entire text?

## Recommended Posts

• 0
Just now, joneslovescaspio said:

hello, in a formula how do you write a CASE WHEN statement that tries to find text in a field that not equals it, but CONTAINS text ?

In a formula instead of finding something that is equal, I would like to find something in the field that CONTAINS the text, so not equal or greater or less but CONTAINS

When [@field1]='apples' then 'fruit'... How do i change the equal sign so that it finds a word in the text but not the entire text?

In your last question, you wanted to have some text as some sort of a static formula such as if it is not equal to fruit, there should be a default word (ex. 'some text')?

##### Share on other sites

• 0
Just now, OppaShinJoonYoung said:

In your last question, you wanted to have some text as some sort of a static formula such as if it is not equal to fruit, there should be a default word (ex. 'some text')?

Yes, exactly.

##### Share on other sites

• 0
Just now, joneslovescaspio said:

Yes, exactly.

Try this:

CASE
WHEN [@field1]  LIKE '%'+'apples'+'%' THEN
'fruit'
ELSE
'some text'
END

##### Share on other sites

• 0

Heyaa! Here's a great reference for similar functions

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.