Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Please help with the mdx query


Please help with the mdx query

Author
Message
Smash125
Smash125
SSC Veteran
SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)

Group: General Forum Members
Points: 217 Visits: 1381
Below is the calculated member

[Estimated Value]=

IIf([Measures].[PRC]=0,null,Sum([Product].[MM#].members-[Product].[MM#].[All],[Measures].[PRC])/[Measures].[MM Count])



SELECT {[Measures].[SO Actual Qty],[Measures].[Estimated Value]} ON COLUMNS,
{ ([Business Unit].[Business Unit].[Business Unit].ALLMEMBERS )} ON ROWS FROM [SMS_CURRENT_WW]
WHERE {[Date- CGID Local].[CGID-QUARTER].&[2013Q1] }



This Calculated Member gives the result as below

SO Actual Qty Estimated Value
(null) (null)
ATM (null) (null)
CCDiv 18491 $15,856.61
CD 2008 $9,156.90
CNG (null) (null)
CNG Div 9448 $20,322.75
CPG Div 26 $14,210.00
CPLG Div (null) (null)
CS (null) (null)
DCG CPU 251 $664,899.00
DCPU Div 9863 $31,271.64
DEG (null) (null)
DHED (null) (null)
DPD Biz (null) (null)
DT 78256 $153,214.08
ECG 3472 $167,510.96
ECG Adm (null) (null)
ECPD (null) (null)
ECPD EMD 15 $1,380.00
EPD (null) (null)
EPSD 52 $23,172.67
ESS (null) (null)
FPD (null) (null)
HQ Div (null) (null)
IAD 1227 $3,757.61
ICBD (null) (null)
ISD Biz (null) (null)
LAD 87417 $65,469.21
LCIA (null) (null)
MBL 283574 $521,188.62
McAD 600 (null)
MCG 9450 $35,109.09
MOCS DIV 27 $540.00
MPG 4152 $10,722.69
MWG (null) (null)
NBD 60 $906.67
NPG (null) (null)
NPP (null) (null)
NSG (null) (null)
NSG Div 19133 $41,750.43
NTD 45 $1,845.00
OPD (null) (null)
OTC Div (null) (null)
PEG Div 3750 $6,583.51
RSD (null) (null)
SPD 4179 $4,570.70
SPG (null) (null)
SRV 97182 $861,521.82
Systems 30 (null)
TCD 411 $11,042.86
UMG 5770 $33,560.00
UPSD 3675 $16,053.29
WiFi 4875 $5,617.33
Unknown (null) (null)



the problem i am faced up is the estimated value is calculated correctly at the business unit level but when u add all the business unit data to get sum it is showing wrond data i e =161,722.688 but when i add manually it is 2721233.43

that means we are doing wrond aggregation can any body guide me how can i fix it
stevefromOZ
stevefromOZ
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: Moderators
Points: 1929 Visits: 3754
Possibly a measure expression will help here but you may need to use more measures to achieve what you're chasing.

Steve.
Smash125
Smash125
SSC Veteran
SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)

Group: General Forum Members
Points: 217 Visits: 1381
Could you please specify. What more measure expression i have to come up. Please if you could help would be great
stevefromOZ
stevefromOZ
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: Moderators
Points: 1929 Visits: 3754
If the basic problem is that you're currently seeing

SUM (A) / SUM (B)
and you want to see

SUM (A/B)

then a measure expression should be able to be used to do that.

As far as what the expression should be, I'll leave that to you to determine. If you google the terms you will find a multitude of examples.

Steve.
Smash125
Smash125
SSC Veteran
SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)SSC Veteran (217 reputation)

Group: General Forum Members
Points: 217 Visits: 1381
Hey Steve sorry to bother you again . Please give me the query my brain has drained out if you could
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search