(How to ?) Slices with multiples row filter condition

Hello,

How can i build a slice with multiple row filter condition ?

Exemple, i would like to show only โ€œnoโ€ of a column containing โ€œyesโ€, โ€œnoโ€, โ€œmaybeโ€.

What correct expression(s) i have to use ?

Thanks

Solved Solved
1 20 5,920
1 ACCEPTED SOLUTION

OR([Column] = "yes", [Column] = "its ok", [Column] = "for sure")

View solution in original post

20 REPLIES 20

Steve
Platinum 4
Platinum 4

([Column] = "no") would appear to be all you need based on your vague question.

Ahah ! Sorry. I reread myself and indeed, my question is weird.

I specify : imagine i have X possibles row filter condition (โ€œmaybeโ€, โ€œone dayโ€, โ€œtoo lateโ€, โ€œno of courseโ€, โ€ฆ). On these, i just want to show Y (โ€œyesโ€, โ€œits okโ€, โ€œfor sureโ€).

What is the correct expression ?

OR([Column] = "yes", [Column] = "its ok", [Column] = "for sure")

Itโ€™s ok !

Thanks all

No Problem, appsheet is great. you will see.

Maybe:

	AND(
		[Column] = "yes",
		[Column] = "its ok",
		[Column] = "for sure"
	)

Another approach:

IN([Column], {"yes", "its ok", "for sure"})

Hey Steve, How would you take a sentence of words and split each word into list? This could be the solution to my question.

You could try splitting on a space: SPLIT([Column], " "). The problem with that is punctuation would fall in with words. So SPLIT("Hi, my name is Steve!", " ") would give:

  • Hi,
  • my
  • name
  • is
  • Steve.

Notice the punctuation in Hi, and Steve..

A bit of a twist on thisโ€ฆiโ€™m trying to use a value in another table to determine if the rows should be included in the slice. Basic terms: column contains values of A,B,C,D
If count A>X then exclude A
If count B>X then exclude B
if count C>X then exclude Cโ€ฆ
โ€ฆyou get the picture. The counts are located on another table and am using Lookup to grab these values and compare to a hardcoded #.

It feels like a simple solution but for some reason I canโ€™t solve for all of the combinations. Is the filter in a Slice additive in this way?

Mike_T
New Member

now that iโ€™ve laid it out, will this workโ€ฆ

And(isblank([useremail column],
And(if (A>X,[letter col]<>โ€œAโ€,[letter col]=โ€œAโ€),
if (B>X,[letter col]<>โ€œBโ€,[letter col]=โ€œBโ€),
if (C>X,[letter col]<>โ€œCโ€,[letter col]=โ€œCโ€),
if (D>X,[letter col]<>โ€œDโ€,[letter col]=โ€œDโ€)
)
)

What is A? What is the count of A?

Please share this expression so we can get some idea of what youโ€™re doing.

What do you mean by additive?

Sorry. I was trying to simplify the expression. I have been having a hard time reading through alot of these posts when every example is using different table and column names. I have to decipher the nomenclature before I can figure out the logic. Here is my attempt at making it work:

AND

(isblank([Booked By]),

AND(

if(LOOKUP(USEREMAIL(),โ€œOwnersโ€, โ€œOwner Emailโ€, โ€œWEP YTDโ€)>=12,[Sail Type]<>โ€œWEPโ€,[Sail Type]=โ€œWEPโ€),

if(LOOKUP(USEREMAIL(),โ€œOwnersโ€, โ€œOwner Emailโ€, โ€œWEA YTDโ€)>=12,[Sail Type]<>โ€œWEAโ€,[Sail Type]=โ€œWEAโ€),

if(LOOKUP(USEREMAIL(),โ€œOwnersโ€, โ€œOwner Emailโ€, โ€œWA YTDโ€)>=36,[Sail Type]<>โ€œWAโ€,[Sail Type]=โ€œWAโ€),

if(LOOKUP(USEREMAIL(),โ€œOwnersโ€, โ€œOwner Emailโ€, โ€œWP YTDโ€)>=24,[Sail Type]<>โ€œWPโ€,[Sail Type]=โ€œWPโ€)

))

Maybe try explaining, in plain english, what the criteria should be for the rows in your slice. Your syntax looks correct, does it return the results you expect? My guess, without knowing your criteria, is that very few records, if any, would be able to meet ALL of these conditions.

You can get rid of one of the AND()s. AND() inside of AND() is redundant.

If an owner is over his allocation of time slots then I would like to exclude these from the list. There are 4 types of time slots. WA, WP, WEA, WEP. Each owner is given a certain number of time slots per year (allocation). Iโ€™m counting the number of instances his email appears in each type. When he meets his allocation, I no longer want him to be able to see these time slots. Iโ€™m trying to use the slice to show only open time slots (no owner email in the [booked by] column. And only show the type of time slots he is eligible to book (hasnโ€™t met allocation).

This formula only returns the โ€œelseโ€ in the first if expression even though all other values should be True.

I just realized that my logic is definitely offโ€ฆeach row is being evaluated on all 5 criteria. I think Iโ€™m trying to do too much with slices

Try something like this:

AND(
  ISBLANK( [Booked By] ) ,

  SWITCH( [Sail Type] ,
    "WEP" ,
    LOOKUP(USEREMAIL(),โ€œOwnersโ€, โ€œOwner Emailโ€, โ€œWEP YTDโ€)>=12
    ,
    "WEA" ,
    LOOKUP(USEREMAIL(),โ€œOwnersโ€, โ€œOwner Emailโ€, โ€œWEA YTDโ€)>=12
    ...
    TRUE
    )
  )

Thank you for trying. I feel like we are getting closer but this didnโ€™t work. It only included the WEP rows when I set the WEP YTD value >=12. When I reset the value to less than 12 I get no results. Here is the expression I used:

AND(
ISBLANK( [Booked By] ) ,

SWITCH( [Sail Type] ,
โ€œWEPโ€, LOOKUP(USEREMAIL(),โ€œOwnersโ€, โ€œOwner Emailโ€, โ€œWEP YTDโ€)>=12,
โ€œWEAโ€, LOOKUP(USEREMAIL(),โ€œOwnersโ€, โ€œOwner Emailโ€, โ€œWEA YTDโ€)>=12,
โ€œWAโ€, LOOKUP(USEREMAIL(),โ€œOwnersโ€, โ€œOwner Emailโ€, โ€œWA YTDโ€)>=24,
โ€œWPโ€, LOOKUP(USEREMAIL(),โ€œOwnersโ€, โ€œOwner Emailโ€, โ€œWP YTDโ€)>=36,
โ€ฆ
TRUE
)
)

Oh, I just copied your existing LOOKUP() formulas. Just flip the equalities around.

OK. You are genius!
I need to go back and reread SWITCH expression over and over.

If there is still time, I sent Santa a note to put you on the top of the nice list!

Thank you again! This is great! Happy Holidays!

You can rewrite it like this, and itโ€™ll perform the same, if that is easier for you to understand. Remember that all statements inside of AND must return a TRUE/FALSE value.

AND(
ISBLANK( [Booked By] ) ,

IFS( 
[Sail Type] = โ€œWEPโ€, LOOKUP(USEREMAIL(),โ€œOwnersโ€, โ€œOwner Emailโ€, โ€œWEP YTDโ€)<12,
[Sail Type] = โ€œWEAโ€, LOOKUP(USEREMAIL(),โ€œOwnersโ€, โ€œOwner Emailโ€, โ€œWEA YTDโ€)<12,
[Sail Type] = โ€œWAโ€, LOOKUP(USEREMAIL(),โ€œOwnersโ€, โ€œOwner Emailโ€, โ€œWA YTDโ€)<24,
[Sail Type] = โ€œWPโ€, LOOKUP(USEREMAIL(),โ€œOwnersโ€, โ€œOwner Emailโ€, โ€œWP YTDโ€)<36,
TRUE
)
)
Top Labels in this Space