Expression help for conditioning a slice

I need to define a slice.

There is a column named [Status], with enum values, say A, B, C, D, E, F, G. There is an associated [Date] Column.

My slice would have to show all records that are not [Status] ‘G’, that are status ‘F’ and with Date = today(), and all that are of status A, B, C, D, E.

Is this slice filter correct :

or(
and([Status]=“F”, [Date]=Today()),
[Status]<>“G”
)
?

Or should I go this path :

or(
and([Status]=“F”, [Date]=Today()),
IN([Status], {“A”, “B”, “C”, “D”, “E”})=TRUE
)

I wonder if using IF() might not be a good approach:

if([Status]=“F”,[Date]=Today(),[Status]<>“G”)

I haven’t tested it but I’m concerned that the second part of your first OR() expression might not allow [Status]=“F”, even when the date is different, thus making your first condition meaningless.

1 Like

Could you please mention if the column [Status] is Enum or Enumlist type?

It’s enum.

Thank you. If it is enum,at a time I believe it can have only single value. So any specific reason you wish to check both “F” and :G" in the same record?

If the [Status] is “F”, then it will not be “G” or anything else in the same record, if it is enum.

Yes, because I want to have those rows in the slice whose [Status] are:

  1. Not G
  2. F and [Date] = Today()
  3. A,B, C,D,E

Ok, got it , thank you. It is clear now.

It sounded that NOT “G” and “F” and [Date] are together.

I believe your below expression looks good.

OR(
AND([Status]=“F”, [Date]=Today()),
IN([Status], {“A”, “B”, “C”, “D”, “E”})
)

I believe you may drop =TRUE after IN() expression,because IN() by its construct, evaluates to TRUE or FALSE

2 Likes

I can see how this would work:

Would my proposal also do the same work?

A quick off topic question (hated to create another thread for this) :

My logo images get thrown out of proportion in the app screen. While I understand it is due to the image being not within the appsheet specified sizes, I don’t know what the specified sizes are in the first place. Where can I find guidelines for this?

Hi @Kirk_Masden,

I believe ,yes, your proposal will also perfectly do the same work.

I believe the thread got extended because @Pratyay_Rakshit had mentioned following statement, so just wanted to be sure he is not using enumlist. Alter that just mentioned that his other expression is ok with minor correction.

1 Like

@Pratyay_Rakshit,

You may wish to take a look at the following article.

2 Likes