Validation check to select a value only once for that particular week

Dear Community,
I have a โ€œLeave typeโ€ field where the Users are supposed to select option, โ€œWeekly Offโ€ only once for that particular week.
I am trying to use count, weeknum and few other functions but couldnโ€™t achieve this.
Pls help.

Thank you.

Solved Solved
0 4 310
1 ACCEPTED SOLUTION

Hi @Kanha_PM_Office,

You may wish to try the following approach. This will work with weekdays defined as WEEKNUM() expression in AppSheet ( I believe Sunday to Saturday)

Please create a VC called say [LeaveCheck] with expression something like

CONCATENATE([Employee Name],"-", WEEKNUM([Leave Date]),"-",YEAR([Leave Date]))

Now in the leave type columnโ€™s valid if constraint, you may have an expression something like

IF([Leave Type]=โ€œWeekly Offโ€, NOT(IN([LeaveCheck], SELECT(Customers[LeaveCheck], NOT(IN([Primary Key], LIST([_THISROW].[Primary Key])))))), TRUE)

View solution in original post

4 REPLIES 4

Hi @Kanha_PM_Office,

You may wish to try the following approach. This will work with weekdays defined as WEEKNUM() expression in AppSheet ( I believe Sunday to Saturday)

Please create a VC called say [LeaveCheck] with expression something like

CONCATENATE([Employee Name],"-", WEEKNUM([Leave Date]),"-",YEAR([Leave Date]))

Now in the leave type columnโ€™s valid if constraint, you may have an expression something like

IF([Leave Type]=โ€œWeekly Offโ€, NOT(IN([LeaveCheck], SELECT(Customers[LeaveCheck], NOT(IN([Primary Key], LIST([_THISROW].[Primary Key])))))), TRUE)

Thank you @Suvrutt_Gurjar

As we now have the EOWEEK() expression you could use USEREMAIL()&EOWEEK(TODAY()) as a key column. Though I donโ€™t know if you can use it as a key columnโ€ฆ just an idea.

Nice suggestion for the use of the new EOWEEK() expression @Aleksi

Top Labels in this Space