Standard Deviation in TM1

Post Reply
User avatar
BigDSter
Posts: 55
Joined: Thu May 15, 2008 8:02 am
OLAP Product: TM1
Version: 9.4.1
Excel Version: 2007
Location: Preston

Standard Deviation in TM1

Post by BigDSter »

Hi all,

Just a quick question. Am currently building a safety stock calculator that was previously in Excel but am replicating in TM1 to make data collection and entry a lot easier.

I can do most of the stuff, just coming a bit of a cropper with one calc.

I need to work out the standard deviation of the forecast error, over a period of last 52 weeks. Simple enough I thought, but there doesn't appear to be a stdev function in TM1 rules, and not quite sure how to use the MDX one. I'd quite like to keep it all in TM1 so would prefer not to wimp out to excel, but the alternative at the minute looks like calculating stdev from first principles, which seems a tad messy.

Hope someone can help, forgive me if I've missed something obvious.

Ta
David Newton
Burtons Foods
User avatar
John Hobson
Site Admin
Posts: 330
Joined: Sun May 11, 2008 4:58 pm
OLAP Product: Any
Version: 1.0
Excel Version: 2020
Location: Lytham UK
Contact:

Re: Standard Deviation in TM1

Post by John Hobson »

Hi David

I did this to calculate store grades based on a bell shaped curve in TM1

In the "Autocluster"cube containing the space by store I had

Code: Select all

['Count'] =  N: 1;
['Square Space'] = N:['Space'] * ['Space'];
and in another higher level cube where I did the calc I had

Code: Select all

['Std Dev Space'] = 
                            SQRT(
                            (DB('AutoCluster',!Plan Version', !Prod_D, !Time Season, 'All Base Stores', 'Square Space')
                            *DB('AutoCluster', !Plan Version', !Prod_D, !Time Season, 'All Base Stores', 'Count'))
                            -(DB('AutoCluster', !Plan Version', !Prod_D, !Time Season, 'All Base Stores', 'Space')
                            *DB('AutoCluster', !Plan Version', !Prod_D, !Time Season, 'All Base Stores', 'Space'))
                            )
                            \ DB('AutoCluster', !Plan Version, !Prod_D, !Time Season, 'All Base Stores', 'Count');
I'm no statistician but it seemed to work :D
John Hobson
The Planning Factory
User avatar
BigDSter
Posts: 55
Joined: Thu May 15, 2008 8:02 am
OLAP Product: TM1
Version: 9.4.1
Excel Version: 2007
Location: Preston

Re: Standard Deviation in TM1

Post by BigDSter »

Ta for that John,

bit late in the day to figure it out, but I'll have a crack at it tomorrow when I'm more awake.

Thanks
David Newton
Burtons Foods
ScottW
Regular Participant
Posts: 152
Joined: Fri May 23, 2008 12:08 am
OLAP Product: TM1 CX
Version: 9.5 9.4.1 9.1.4 9.0 8.4
Excel Version: 2003 2007
Location: Melbourne, Australia
Contact:

Re: Standard Deviation in TM1

Post by ScottW »

Standard Deviation and other basic statistical functions is something that TM1 doesn't do well. Calculating averages and counts are OK but StDev is a real chore. It's doable if you do the algebra from 1st principles a la Mr Hobson but this will be a high overhead rule to calculate. IMO if the dataset is big then easier and better performance to pipe out into an SQL database, do the calculation there and pipe it back in.

I'm not sure that TM1's implementation of MDX would handle standard deviation, if you get it to work please let me know!

TM1 does handle MAPE very well which is the generally accepted best practice measure for demand planning forecast accuracy. Are you taking the next step with deriving theoretical safety stock via Orlicky & Plossl's method from the mean absolute error? ... shouldn't your MRP/ERP system be able to spit this out for you? (assuming the demand plan is loaded in?) It is a straightforward calculation in Excel, the problem in TM1 is really just the stDev as you have already figured!

I'm not sure that that helps ... :(
Cheers,
Scott W
Cubewise
www.cubewise.com
gavod
Posts: 1
Joined: Thu Feb 16, 2012 4:00 pm
OLAP Product: TM1
Version: 9.5.1
Excel Version: 2010

Re: Standard Deviation in TM1

Post by gavod »

Hi,

Was the STDEV issue addressed in newer releases? Is shows up on the supported functions in the IBM documentation for 9.5.1.
If so , what is the synax?

Thanks.
David Usherwood
Site Admin
Posts: 1458
Joined: Wed May 28, 2008 9:09 am

Re: Standard Deviation in TM1

Post by David Usherwood »

It's supported as an MDX function. Since there's no sensible way I've found to do anything with MDX except to drive dynamic subsets, the expression 'chocolate teapot' comes to mind. If the community have worked out how to bypass this I'd be delighted.
Andy Key
MVP
Posts: 352
Joined: Wed May 14, 2008 1:37 pm
OLAP Product: TM1
Version: 2.5 to PA
Excel Version: Lots
Location: Sydney
Contact:

Re: Standard Deviation in TM1

Post by Andy Key »

Obviously it would be preferable if TM1 would do it for you, but Standard Deviations are actually quite easy to code from first principles. I don't have a copy of the system that I used it in with me, but I'll dig it out over the weekend.
Andy Key
ravi
Posts: 138
Joined: Mon Apr 26, 2010 12:39 pm
OLAP Product: cognos
Version: tm1 9.5
Excel Version: 2007

Re: Standard Deviation in TM1

Post by ravi »

Hi

There are clients planning to have IBM SPSS as -IBM Cognos TM1 can be extended with IBM SPSS Modeler to provide extended statistical modeling.Please provide your comments.
Regards,
Ravi
David Usherwood
Site Admin
Posts: 1458
Joined: Wed May 28, 2008 9:09 am

Re: Standard Deviation in TM1

Post by David Usherwood »

@Andy - indeed, that's what I generally do. (I've recently had to built MMULT in TM1).
@ravi - what have you been told about SPSS/TM1 integration? I don't think there is any at present.
Andy Key
MVP
Posts: 352
Joined: Wed May 14, 2008 1:37 pm
OLAP Product: TM1
Version: 2.5 to PA
Excel Version: Lots
Location: Sydney
Contact:

Re: Standard Deviation in TM1

Post by Andy Key »

@David - Never doubted it for a minute!

My method basically boils down to the same as John's. I actually wanted to do a Population SD rather than the Sample SD calculation shown above, but I had to go with the Sample SD as I had to tie it back to the client's Excel spreadsheet.

Yay Excel.
Andy Key
Post Reply