Which expression is best to use in this example

Gardener76
Participant IV

Hi

I have an app that monitors swimmers who are either in or out of the pool. Each swimmer will enter and exit the pool twice. So I have the following columns:

[Start] Initial value of 00:00.

[Swim Exit 1] Initial value of 00:00.

[Swim Entry 2] Initial value of 00:00.

[Finish] Initial value of 00:00.

[Swim Status]

What expression would I use in column [Swim Status] to show whether the swimmer is โ€œINโ€ or โ€œOUTโ€ of the pool?

TIA your expertise is much appreciated.

Solved Solved
0 8 180
1 ACCEPTED SOLUTION

Missing comma. Try:

IFS(	
	OR(
		NOT([_THISROW_BEFORE].[START] = [_THISROW_AFTER].[START]),
		NOT([_THISROW_BEFORE].[SWIM ENTRY 2] = [_THISROW_AFTER].[SWIM ENTRY 2])
		
	),"IN",
	OR(
		NOT([_THISROW_BEFORE].[SWIM EXIT 1] = [_THISROW_AFTER].[SWIM EXIT 1]),
		NOT([_THISROW_BEFORE].[FINISH] = [_THISROW_AFTER].[FINISH])
	),"OUT"
)

View solution in original post

8 REPLIES 8

LeventK
Participant V

This goes to AppFormula of [Swim Status] column:

IFS(	
	OR(
		NOT([_THISROW_BEFORE].[START] = [_THISROW_AFTER].[START]),
		NOT([_THISROW_BEFORE].[SWIM ENTRY 2] = [_THISROW_AFTER].[SWIM ENTRY 2])
		
	),"IN",
	OR(
		NOT([_THISROW_BEFORE].[SWIM EXIT 1] = [_THISROW_AFTER].[SWIM EXIT 1]),
		NOT([_THISROW_BEFORE].[FINISH] = [_THISROW_AFTER].[FINISH])
	)"OUT"
)

Gardener76
Participant IV

@LeventK thank you for your suggestion, however it came up with this error.

IFS function is used incorrectly:Inputs to IFS() must be one or more condition-value pairs.

Missing comma. Try:

IFS(	
	OR(
		NOT([_THISROW_BEFORE].[START] = [_THISROW_AFTER].[START]),
		NOT([_THISROW_BEFORE].[SWIM ENTRY 2] = [_THISROW_AFTER].[SWIM ENTRY 2])
		
	),"IN",
	OR(
		NOT([_THISROW_BEFORE].[SWIM EXIT 1] = [_THISROW_AFTER].[SWIM EXIT 1]),
		NOT([_THISROW_BEFORE].[FINISH] = [_THISROW_AFTER].[FINISH])
	),"OUT"
)

@Steve @LeventK

Thank you both so much, this works.

Where can I go to learn this level of code?

Here. And help.appsheet.com. And practice, practice, practice!

I perfectly agree. Here and official docs.

Austin
Participant V

To quote a song I like, Appsheet is 10% luck 20% skill more like 70% will and hundreds of hours in documents and crawling the forum. The 50% pain and pleasure is more like 90-10 but I digress.

Gardener76
Participant IV

@Steve, thank you.

would there be any reason why this expression would stop working if i update another column in this sheet?

I have other columns in the sheet, like feed 1, feed 2 etc, and it seems when I update these, the [Swim Status] expression (as above) doesnt work.

Top Labels in this Space