correct formula to calculate column values (problems with Cannot compare List with Number)

Hi all,
I have two tables within my AppSheet. one of them called "Children" and the other one called "TImeSheet". Within the table "TimeSheet" I need to calculate values based on different values from the table "Children". I have in the table *Children" the two columns "Age" and "CareGiverAge". Booth of them are formatted as number.
In the table "TimeSheet" I have a column called "CompleteHours".
I need to calculate within the column "TotalAmountHours" the decimal number based on this formula.

IFS(
(AND(Children[CareGiverAge] < 50, Children[Age] < 1)), [CompleteHours] * 10.5,
(AND(Children[CareGiverAge] < 50, Children[age] >= 1)), [CompleteHours] * 6.85,
(AND(Children[CareGiverAge] >= 50, Children[age] < 1)), [CompleteHours] * 10.85,
(AND(Children[CareGiverAge] >= 50, Children[age] >= 1)), [CompleteHours] * 7.05
)

I get the following error: Cannot compare List with Number in (Children[CareGiverAge] < 50)
How can I resolve the error to calculate the amount.
Thanks for your help.

Solved Solved
0 3 93
1 ACCEPTED SOLUTION

I assume you need to calculate the value for a specific row in Timesheet table. Then it would be something like..

IFS(
AND(
LOOKUP([_THISROW].[Name],Children,Name,CareGiverAge) < 50,
LOOKUP([_THISROW].[Name],Children,Name,Age) < 1),
[CompleteHours] * 10.5,
And so on..

View solution in original post

3 REPLIES 3

I assume you need to calculate the value for a specific row in Timesheet table. Then it would be something like..

IFS(
AND(
LOOKUP([_THISROW].[Name],Children,Name,CareGiverAge) < 50,
LOOKUP([_THISROW].[Name],Children,Name,Age) < 1),
[CompleteHours] * 10.5,
And so on..

that was it - thanks!
I still had to adapt it to my column names, but the functionality is correct.

You're welcome!

Top Labels in this Space