Question
· Nov 22

Calculate STD DEV with ObjectScript

Hence the question: is there a way to do that?

The goal is to get data (from half a thousand to 3-4 thousands lines) from DB, calculate standart deviation  then use it as logical condition in analyzer. 

For example IF std > custom_value = show_the_result ELSE null

There is a STDDEV(MDX) method  used in Analyzer but it is a measure and it can not be used as logical condition (correct me if i am wrong)

And there is a Embedded Python with numpy, but logic behind STDDEV(MDX) and numpy.std are different, apart of that Embedded python is a poorly produced gimmick and if i want to use python i would created entire analytics on it (i already did and now i need to transfer the concept into IRIS) 

Then there is STDDEV(SQL) method. It is very slow and thats it

And lastly we have %DeepSee.KPI. It is possible solution but our goal is to avoid it at all costs

'Community AI' tells me to ask here (if you think to ask it first, i've already did that)

Thank you in advance!

Product version: IRIS 2024.1
Discussion (2)1
Log in or sign up to continue

You could write your own std deviation ClassMethod() in ObjectScript. You then have the flexibility to use that however you want.

The logic doesn't look that complex, and for a few thousand rows would run fast enough in Object Script.

See link below for the calculations you need to do:

https://www.scribbr.com/statistics/standard-deviation/

You can validate your results with the STDDEV(SQL) method, which will also allow you to compare performance.