Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Please help with the mdx query Expand / Collapse
Author
Message
Posted Wednesday, July 24, 2013 4:52 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 4:13 AM
Points: 210, Visits: 1,211
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
Post #1476978
Posted Wednesday, July 24, 2013 6:09 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: Moderators
Last Login: 2 days ago @ 6:34 PM
Points: 1,846, Visits: 3,575
Possibly a measure expression will help here but you may need to use more measures to achieve what you're chasing.


Steve.
Post #1477022
Posted Wednesday, July 24, 2013 6:15 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 4:13 AM
Points: 210, Visits: 1,211

Could you please specify. What more measure expression i have to come up. Please if you could help would be great
Post #1477023
Posted Wednesday, July 24, 2013 6:23 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: Moderators
Last Login: 2 days ago @ 6:34 PM
Points: 1,846, Visits: 3,575
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.
Post #1477028
Posted Wednesday, July 24, 2013 10:25 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 4:13 AM
Points: 210, Visits: 1,211

Hey Steve sorry to bother you again . Please give me the query my brain has drained out if you could
Post #1477337
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse