I'd like to set a limit so that I can only save it once a week.

Hello

I'm trying to make A provide points once a week and B provide points once a day. With the Valid if function, I've asked Person B to provide points once a day, but how do I code Person A to provide points once a week?

Below is the Valid if coding to provide points once a day.

IF(
IN([Writer], {"B"}),
COUNT(
FILTER(
"Thumbs Up",
AND(
([Writer ID] = [_THISROW].[WRITER ID]),
(AND(YEAR([_THISROW].[])=YEAR([Point Offered Day]), MONTH([_THISROW].[Point Offered Day])=MONTH([Point Offered Day]), DAY([_THISROW].[Point Offered Day])=DAY([Point Offered Day])))
)
)
) < 1,
false

Solved Solved
0 4 150
1 ACCEPTED SOLUTION

Another option to try in the valid_if of the column could be 

IFS([Writer]="A",

ISBLANK(

FILTER("Thumbs Up",

             AND(  [Writer]="A",  EOWEEK([Point Offered Day])=EOWEEK(TODAY()))

                )

             - LIST([_THISROW])

              ) ,

[Writer]="B",

ISBLANK(

FILTER("Thumbs Up",

             AND(  [Writer]="B",  [Point Offered Day]=TODAY())

                )

             - LIST([_THISROW])

              ) 

)

Note: Week is considered from Sunday to Saturday as AppSheet EOWEEK() expression works from Sunday to Saturday. The expression will need some tweak to accommodate other definition of week such as Monday-Sunday.

Please see the expression for avoiding duplicates at the end of the article below

List expressions - AppSheet Help

EOWEEK() - AppSheet Help

 

 

       

View solution in original post

4 REPLIES 4

Try it out:

 

IF(IN([Writer], {"A"}),
    WEEKNUM(ANY(SORT(SELECT(
        Thumbs Up[Point Offered Day],
        [Writer ID] = [_THISROW].[WRITER ID]
    ),
    TRUE))) < WEEKNUM(TODAY()),
FALSE
)

 

It is supposed to get the last day the user provided a point and verify if that week of the year comes before the current week of the year.

 

Another option to try in the valid_if of the column could be 

IFS([Writer]="A",

ISBLANK(

FILTER("Thumbs Up",

             AND(  [Writer]="A",  EOWEEK([Point Offered Day])=EOWEEK(TODAY()))

                )

             - LIST([_THISROW])

              ) ,

[Writer]="B",

ISBLANK(

FILTER("Thumbs Up",

             AND(  [Writer]="B",  [Point Offered Day]=TODAY())

                )

             - LIST([_THISROW])

              ) 

)

Note: Week is considered from Sunday to Saturday as AppSheet EOWEEK() expression works from Sunday to Saturday. The expression will need some tweak to accommodate other definition of week such as Monday-Sunday.

Please see the expression for avoiding duplicates at the end of the article below

List expressions - AppSheet Help

EOWEEK() - AppSheet Help

 

 

       

Thank you for your kind support. I have one more question.

How do I code Person A to provide points twice a week?

Please try

IFS([Writer]="A",

COUNT(

FILTER("Thumbs Up",

             AND(  [Writer]="A",  EOWEEK([Point Offered Day])=EOWEEK(TODAY()))

                )

             - LIST([_THISROW])

              ) <=1,

[Writer]="B",

ISBLANK(

FILTER("Thumbs Up",

             AND(  [Writer]="B",  [Point Offered Day]=TODAY())

                )

             - LIST([_THISROW])

              ) 

)

 

Please test well.

Top Labels in this Space