use and and or in the same formula

Hello everyone, I hope you are very well.

I wanted to request help to find the formula that solves my problem in Appsheet.

I need to fetch all the results of the sub_date column when it is not empty, and I need to fetch all the results of the state column when it has the following values: analysis, docs and when the field is empty.

It is worth clarifying that the state column has several types of extra values, which do not interest me in the formula either.

 

Solved Solved
0 6 200
1 ACCEPTED SOLUTION

Hello, sorry for the delay, this was the solution to the problem.

AND(
ISNOTBLANK([sub_DATE]),
OR(
ISBLANK([STATE]),
IN([STATE], {"ANALYSIS", "DOCS"})
))

View solution in original post

6 REPLIES 6

So just to be clear you want all rows which have a value in [sub_date] as well as any other rows which have "analysis", "docs" or empty [state] column? The following should work:

OR(
  ISNOTBLANK([sub_date]),
  ISBLANK([state]),
  IN([state], {"analysis", "docs"})
)

Hi Graham, thanks for the help.

I tried your script, but unfortunately it failed. It brings the incomplete fields (The filter in the sub_date column seems not to work). It also brings me the other values โ€‹โ€‹of the state column.

I think I misunderstood your requirement then, I thought you wanted to include all rows with a value in [sub_date], even if they had values you were not interested in for [state]? Could you provide an example of some rows that this expression returns which you do not actually want?

Hello, sorry for the delay, this was the solution to the problem.

AND(
ISNOTBLANK([sub_DATE]),
OR(
ISBLANK([STATE]),
IN([STATE], {"ANALYSIS", "DOCS"})
))

hello, it would be better to use a formula with SELECT

Where are you going to put this formula?

Top Labels in this Space