drewkiimon
drewkiimon

Reputation: 591

Calculated Field to see if point is greater than Standard Deviation

So instead of having a SUM of all the amounts per person, I now instead have a Circle View of all the amounts they have spent (each circle being a transaction).

Now, I need to create a calculated field to see if a transaction is above the standard deviation of ALL transactions (hence making it an outlier).

Any way you can help me create a calculated field? I keep getting errors.

My Calculated Field formula went something like this

If [AMOUNT] > STDEV([AMOUNT]) THEN "bad"
ELSE "good"
END

My Data Points Image

Upvotes: 0

Views: 672

Answers (2)

Alex Blakemore
Alex Blakemore

Reputation: 11921

Put curly braces {} around the second expression, but not the first.

if [AMOUNT] > { STDEV([AMOUNT]) } then ...

To understand why, read about LOD calculations in the online help

Upvotes: 0

Jose Cherian
Jose Cherian

Reputation: 7747

You cannot mix aggregate and non-aggregate arguements. You need to use an LOD (Level of Detail) expression in this case. Below is a valid calculation.

If [AMOUNT] > {STDEV([AMOUNT])} THEN "bad"
ELSE "good"
END 

You can change the expression based on the Level Of detail required. Please refer to this article for detailed explanation.

Upvotes: 1

Related Questions