Announcements
The Google Cloud Community will be in read-only from July 16 - July 22 as we migrate to a new platform; refer to this community post for more details.

Validating Data range

Hi, Im new to the community, Ive made some apps with Appsheet, but I cant find the way for validating a date range. Havent worked with dates in past apps.

This is what i want to do.

I have a two tables (MasterData, and Weeks). In the Weeks table I have 3 columns the number of the week (WeekNum) based on business information. The start date of the week and the end of the week.

What I need is that when some one inserts a date on a form from the MasterData table, apsheet returns the week number that matches that range.

This is the expressiรณn Ive been trying to create in my MasterData base but it gives me the List of all values in WeekNum, instead of the number that matches the date range.

select(Weeks[WeekNum],
AND(
Any(Weeks[Start])<=[_ThisRow].[Date]
,Any(Weeks[End]>=[_ThisRow].[Date]
))

Thanks

Solved Solved
0 2 390
1 ACCEPTED SOLUTION

Aurelien
Google Developer Expert
Google Developer Expert

Hi @guscuesta

I think you are using SELECT improperly.

What about that ?

ANY(
  SELECT(
    Weeks[WeekNum],
    AND(
      [Start]<=[_ThisRow].[Date],
      [End]>=[_ThisRow].[Date]
    )
  )
)

Also, you can have this formula recently released by AppSheet Dev Team:

For reference:

View solution in original post

2 REPLIES 2

Aurelien
Google Developer Expert
Google Developer Expert

Hi @guscuesta

I think you are using SELECT improperly.

What about that ?

ANY(
  SELECT(
    Weeks[WeekNum],
    AND(
      [Start]<=[_ThisRow].[Date],
      [End]>=[_ThisRow].[Date]
    )
  )
)

Also, you can have this formula recently released by AppSheet Dev Team:

For reference:

Excelent that solved my problem, as you say I was not using SELECT right.

Thanks

Top Labels in this Space