Need help in Expression in Column type Enum in Valid_if

My current expression in Valid If -

COUNT(FILTER(“Child”, AND([_THIS] = [Parent].[Ride],[Date] = [Parent].[Date]))) <1

Here I want to give multiple conditions with values using OR () like below but its not working,

OR ( 
COUNT(FILTER(“Child”, AND([Ride] = "1 Hour Ride (09:00 AM to 10:00 AM)",[Date] = [Parent].[Date]))) <1, 
COUNT(FILTER(“Child”, AND([Ride] = "Dinner Cruise (06:00 PM to 08:00 PM)",[Date] = [Parent].[Date]))) <1
)

Please assist me on the above . @Steve

Solved Solved
0 13 307
1 ACCEPTED SOLUTION

Hi Steve,
Happy New Year wishes and hope you are doing great !!

I really appreciate your help @Steve and thanks alot for all the assistance and help you provided me on this.

Just a note :
I have tried the solution given by you and it was giving error in select(), However your expression has created an idea for me and i have tried the same thing using IFS() so the expression I created is as mentioned below and it worked perfectly -

COUNT(FILTER(“Child”, AND([_THIS] = [Parent].[Ride],[Date] = [Parent].[Date]))) <
IFS([Ride]=“1 Hour Ride (09:00 AM to 10:00 AM)”,10,
[Ride]=“1 Hour Ride (02:30 PM to 03:30 PM)”,10,
[Ride]=“Dinner Cruise (06:00 PM to 08:00 PM)”,16,
[Ride]=“Dinner Cruise (08:00 PM to 10:00 PM)”,16)

View solution in original post

13 REPLIES 13

Hi @Steve

I didn’t get it …

Please clarify

Steve
Platinum 4
Platinum 4

Please describe what you want in plain language, without using any AppSheet terms.

Hi @Steve ,
Thanks for the reply… and hope you are doing good !!

In the Enum column [Ride] in Valid_IF using OR() function I am passing two conditional expressions but its not working… Am I doing the right approach?

Please assist, I can add you in my app also so that you can take better overview.

Please describe what you want in plain language, without using any AppSheet terms.

Hi @Steve
Thanks for the reply and hope you are well !

I have 4 (four) rides and those are : 1) “1 Hour Ride (09:00 AM to 10:00 AM)”, 2) “1 Hour Ride (02:30 PM to 03:30 PM)”, 3) “Dinner Cruise (06:00 PM to 08:00 PM)”, 4) “Dinner Cruise (08:00 PM to 10:00 PM)”.

I want to limit the total data entries in the child table for a particular Ride on a particular Date to count suppose 10 .

For example: When I select a ride and a date from the date picker and start entering the data > the max entries should be limited to suppose 10 or any number. And if suppose 10 entries are done it will ask to select the next date.

So each ride for each date will have only 10 entries allowed.

Please Kindly help an expression for this condition.

Thanks
Javed

Try this:

OR(
  ISBLANK([Date]),
  (
    COUNT(
      FILTER(
        "Child",
        AND(
          ([Ride] = [_THIS]),
          ([Date] = [_THISROW].[Date])
        )
      )
    )
    < 10
  )
)

Hi @Steve
Thanks for the reply and hope you are doing good !!

Please I forgot to mention one part and really need help for the below one -

As I have 4 (four) rides and those are : 1) “1 Hour Ride (09:00 AM to 10:00 AM)”, 2) “1 Hour Ride (02:30 PM to 03:30 PM)”, 3) “Dinner Cruise (06:00 PM to 08:00 PM)”, 4) “Dinner Cruise (08:00 PM to 10:00 PM)”.

Basically, when I select ride #1 and ride #2 and a date from the date picker and start entering the data > the max entries should be limited to suppose count “16”.

And

when I select ride #3 and ride #4 and a date from the date picker and start entering the data > the max entries should be limited to suppose count “26”.

Please help an expression for the above condition.

Thanks
Javed

Hi @Steve

Hope you are doing good !! and belated merry christmas wishes !!

Please update on the above query…

Thanks & Regards
Javed

That information would have been helpful initially. I’ve already spent enough time with your problem. Please demonstrate that you’ve tried to use the suggestion I provided to solve your problem.

Hi @Steve
Hope you are doing well !

I really appreciate and grateful to you so far you have helped me a lot for the solution …

The solution provided by you in 7th comment is not working, so I just modified a bit on it and tried the below expression

(COUNT(FILTER(“Child”, AND([_THIS] = [Parent].[Ride],[Date] = [Parent].[Date]))) < 10)

It’s working But still I re-analyzed and finally, I require the functionality to be like below mentioned and I really need your help on this as I want to limit the count for individual/each ride and for each date.
"
As I have 4 (four) rides and those are : 1) “1 Hour Ride (09:00 AM to 10:00 AM)”, 2) “1 Hour Ride (02:30 PM to 03:30 PM)”, 3) “Dinner Cruise (06:00 PM to 08:00 PM)”, 4) “Dinner Cruise (08:00 PM to 10:00 PM)”.

Basically, when I select ride #1 and ride #2 and a date from the date picker and start entering the data > the max entries should be limited to suppose count “16”.

And

when I select ride #3 and ride #4 and a date from the date picker and start entering the data > the max entries should be limited to suppose count “26”.
"

Thanks & Regards,
Javed

OR(
  ISBLANK([Date]),
  (
    COUNT(
      FILTER(
        "Child",
        AND(
          ([Ride] = [_THIS]),
          ([Date] = [_THISROW].[Date])
        )
      )
    )
    < SELECT(
      [Ride],
      "1 Hour Ride (09:00 AM to 10:00 AM)”, 10,
      “1 Hour Ride (02:30 PM to 03:30 PM)”, 10,
      “Dinner Cruise (06:00 PM to 08:00 PM)”, 16,
      “Dinner Cruise (08:00 PM to 10:00 PM)", 16,
      0
    )
  )
)

Hi Steve,
Happy New Year wishes and hope you are doing great !!

I really appreciate your help @Steve and thanks alot for all the assistance and help you provided me on this.

Just a note :
I have tried the solution given by you and it was giving error in select(), However your expression has created an idea for me and i have tried the same thing using IFS() so the expression I created is as mentioned below and it worked perfectly -

COUNT(FILTER(“Child”, AND([_THIS] = [Parent].[Ride],[Date] = [Parent].[Date]))) <
IFS([Ride]=“1 Hour Ride (09:00 AM to 10:00 AM)”,10,
[Ride]=“1 Hour Ride (02:30 PM to 03:30 PM)”,10,
[Ride]=“Dinner Cruise (06:00 PM to 08:00 PM)”,16,
[Ride]=“Dinner Cruise (08:00 PM to 10:00 PM)”,16)

Whoops! Should have been SWITCH(), not SELECT(). Here it is corrected:

OR(
  ISBLANK([Date]),
  (
    COUNT(
      FILTER(
        "Child",
        AND(
          ([Ride] = [_THIS]),
          ([Date] = [_THISROW].[Date])
        )
      )
    )
    < SWITCH(
      [Ride],
      "1 Hour Ride (09:00 AM to 10:00 AM)”, 10,
      “1 Hour Ride (02:30 PM to 03:30 PM)”, 10,
      “Dinner Cruise (06:00 PM to 08:00 PM)”, 16,
      “Dinner Cruise (08:00 PM to 10:00 PM)", 16,
      0
    )
  )
)

Outstanding! Very well done!

Top Labels in this Space