Calculation Eror

I’m using the following expression to calculate repair costs of parts of 2 different models of devices:
SUM(SELECT(Parts[COST],AND([MODEL]=[_THISROW].[MODEL],IN([PART],[_THISROW].[PARTS]))))

For the 2 models, only 2 of the parts are doubling costs. ALL the rest of the parts are calculating correctly. For example a screen is $33, but calculates as $66. I can see the part cost as $33.

0 6 351
6 REPLIES 6

Steve
Platinum 4
Platinum 4

If there exist rows in the Parts table with a blank Model column value, your SELECT() will include them.

A peculiarity of AppSheet’s is-equal–to? operator (=) is that it evaluates as TRUE if the left-hand operand is blank, regardless the value of the right-hand operand.

Within your AND() expression, include ISNOTBLANK([Model]) to ensure rows with a blank Model column value aren’t counted.

So it should read as follows?

SUM(SELECT(Parts[COST],AND(ISNOTBLANK([Model])=[_THISROW].[MODEL],IN([PART],[_THISROW].[PARTS]))))

Like this:

SUM(SELECT(Parts[COST],AND(ISNOTBLANK([MODEL]),[MODEL]=[_THISROW].[MODEL],IN([PART],[_THISROW].[PARTS]))))

Same results. I have 2 models of devices. Each model has 11 parts from which our techs can choose. Only 3 of the 11 parts are doubling. For each model the same exact 3 parts are doubling. The parts are listed separately in my parts table and are not shared by device model since the costs are different.

Looks like it might be a look up issue. Each model has most of the same parts that are replaced. Only 3 of the parts have the same charges. So, perhaps, when the app is looking up which parts, it is seeing the duplicate (ie. screen ($33)) and choosing screen from both models because the part verbiage is exactly the same.

That sounds like it.

Top Labels in this Space