Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stdev in MDX

Status
Not open for further replies.

justinmarkham

Programmer
Joined
Feb 21, 2002
Messages
9
Location
GB
Hi all,
Has anyone here had any degree of success in using the stdev function in MS OLAP.
I have a field already in the fact table which I would like to calculate the stdev as a measure, like if it was an aggregate function. However the formula stdev (SET [, Numeric Expression]) does seem to be slightly irritating.
I've tried creating a dimension based on the field and then using the Dimension.members property for the set and have had little success.

The Data is along the lines of a survey response which can map to text responses. eg
Response Response mapping Question
1 Very Dissatisfied 1
2 Very Dissatisfied 1
3 Very Dissatisfied 1
4 Somewhat dissatisfied 1
5 Somewhat Satisfied 1
6 Somewhat Satisfied 1
7 Somewhat Satisfied 1
8 Very Satisfied 1
9 Very Satisfied 1
1 Yes 2
2 No 2

so if question 1 is selected I can see the stdev of all answers 1 through 9 or 1 through 3 if Very dissatisfied is also selected as a column or slicer.

Technet and MS help is kinda vague on this issue so I would appreciate any help and experience anyone has to offer.

Thanks in advance
Justin Markham.
 
Hi!
I use LinRegSlope function which has very similary
syntax ( Set, NumericExpression, RankExpression ).
To calc linregslope you must have x-axis of data (which is
usually a timeline and y-axis - values of points. So:

LinRegSlope ( [Time Set], ( tuple of rest dimensions ), Rank( [Time].CurrentMember, [Time Set]))

Rank returns number of position current member in [Time set]. It starts from 1. This parameter is optional.
[Time Set] is set of choosed time dimension members.
(tuple) has one member from each dimension. Eg.

LinRegSlope ( [Time Set], ( [Client].[ClientX],
[Product].[Product Y],
[Measures].[Sales] ),
Rank([Time].Currentmember, [Time Set]) )

I hope it will help you!

Best regards
Grzegorz Stolecki
stolecki@consorg.com.pl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top