Time Dimension is not bahving propery in my MDX
-
Thursday, June 14, 2012 1:37 PM
Hi,
In my DW i have mapped my Transaction table with Acquirer Dimension and one more Time Dimension now when i run a MDX for any specific Range , for few ranges it gives me accurate data but in some ranges its producing simply wrong data.
SELECT {[Measures].[Transaction Amount]} ON COLUMNS,
([V Dim Acquirer].[Acquirer Name].[Acquirer Name]) on rows
FROM (SELECT {strtomember('[V Dim Time].[Date Only].[2012-05-15]'):strtomember('[V Dim Time].[Date Only].[2012-06-13]')} ON COLUMNS
FROM TRMLIVE )
Transaction Amount
AIRTEL-MONEY 56400
AMEX 1820612507
AXIS 7526461831
CITIBANK 19131304788
COD 2405917599
CORP BANK 20408150
CUB (null)
... etcquery written above extract the accurate records , now its surprisingly when i put any other data ranges it provides accurate data for that and for other few ranges it provides wrong data. even more surprisingly in all few ranges (in which i m getting wrong set of data) i am getting the same set of wrong data as its explained here.
Example
SELECT {[Measures].[Transaction Amount]} ON COLUMNS,
topcount([V Dim Acquirer].[Acquirer Name].[Acquirer Name],10,[Measures].[Transaction Amount]) on rows
FROM (SELECT {strtomember('[V Dim Time].[Date Only].[2012-05-13]'):strtomember('[V Dim Time].[Date Only].[2012-05-14]')} ON COLUMNS
FROM TRMLIVE )or
SELECT {[Measures].[Transaction Amount]} ON COLUMNS,
topcount([V Dim Acquirer].[Acquirer Name].[Acquirer Name],10,[Measures].[Transaction Amount]) on rows
FROM (SELECT {strtomember('[V Dim Time].[Date Only].[2012-05-20]'):strtomember('[V Dim Time].[Date Only].[2012-05-30]')} ON COLUMNS
FROM TRMLIVE )Transaction Amount
HDFC 61815526971
CITIBANK 19126483088
AXIS 7521798031
ICICI 5577155993
AMEX 1804454807
IDBI 1296258849
CORP BANK 20408150
AIRTEL-MONEY 800
COD (null)
CUB (null)so both the query is returning same data and in both the case data is wrong , now i am confuse that why some times date range behaves very well and for some times it return wrong set of data and more surprisingly a same set of wrong data, in furhter analysis when execute the inner MDX only then again i found more surprising records as mentioend below
SELECT {strtomember('[V Dim Time].[Date Only].[2012-05-13]'):strtomember('[V Dim Time].[Date Only].[2012-05-14]')} ON COLUMNS
FROM TRMLIVEall dates as columns header and amounts in one row, you can see its returning data from 1970 to till date , that wrong data are in my DW but why its comming in to my query
1970-01-01 1970-01-02 1970-01-11 1970-01-12 1970-01-14 1970-01-25 1970-01-27 1970-02-13 2004-03-19 2010-12-07 2010-12-08 2010-12-09 2010-12-10 2010-12-11 2010-12-12 2010-12-13 2010-12-14 2010-12-15 2010-12-16 2010-12-17 2010-12-19 2010-12-20 2010-12-21 2010-12-22 2010-12-23 2010-12-24 2010-12-25 2010-12-26 2010-12-27 2010-12-28 2011-01-20 2011-01-21 2011-01-22 2011-01-23 2011-02-02 2011-02-03 2011-02-10 2011-02-11 2011-02-12 2011-02-14 2011-02-15 2011-02-16 2011-02-17 2011-02-18 2011-02-19 2011-02-21 2011-02-22 2011-02-23 2011-02-24 2011-02-26 2011-03-01 2011-03-11 2011-03-17 2011-03-18 2011-03-22 2011-03-24 2011-03-26 2011-03-27 2011-03-28 2011-03-29 2011-03-31 2011-04-01 2011-04-04 2011-04-05 2011-04-06 2011-04-07 2011-04-08 2011-04-09 2011-04-10 2011-04-11 2011-04-12 2011-04-13 2011-04-14 2011-04-15 2011-04-16 2011-04-17 2011-04-18 2011-04-19 2011-04-20 2011-04-21 2011-04-22 2011-04-23 2011-04-24 2011-04-25 2011-04-26 2011-04-27 2011-04-28 2011-04-29 2011-04-30 2011-05-01 2011-05-02 2011-05-03 2011-05-04 2011-05-05 2011-05-06 2011-05-07 2011-05-08 2011-05-09 2011-05-10 2011-05-11 2011-05-12 2011-05-13 2011-05-14 2011-05-15 2011-05-16 2011-05-17 2011-05-18 2011-05-19 2011-05-20 2011-05-21 2011-05-22 2011-05-23 2011-05-24 2011-05-25 2011-05-26 2011-05-27 2011-05-28 2011-05-29 2011-05-30 2011-05-31 2011-06-01 2011-06-02 2011-06-03 2011-06-04 2011-06-05 2011-06-06 2011-06-07 2011-06-08 2011-06-09 2011-06-10 2011-06-11 2011-06-12 2011-06-13 2011-06-14 2011-06-15 2011-06-16 2011-06-17 2011-06-18 2011-06-19 2011-06-20 2011-06-21 2011-06-22 2011-06-23 2011-06-24 2011-06-25 2011-06-26 2011-06-27 2011-06-28 2011-06-29 2011-06-30 2011-07-01 2011-07-02 2011-07-03 2011-07-04 2011-07-05 2011-07-06 2011-07-07 2011-07-08 2011-07-09 2011-07-10 2011-07-11 2011-07-12 2011-07-13 2011-07-14 2011-07-15 2011-07-16 2011-07-17 2011-07-18 2011-07-19 2011-07-20 2011-07-21 2011-07-22 2011-07-23 2011-07-24 2011-07-25 2011-07-26 2011-07-27 2011-07-28 2011-07-29 2011-07-30 2011-07-31 2011-08-01 2011-08-02 2011-08-03 2011-08-04 2011-08-05 2011-08-06 2011-08-07 2011-08-08 2011-08-09 2011-08-10 2011-08-11 2011-08-12 2011-08-13 2011-08-14 2011-08-15 2011-08-16 2011-08-17 2011-08-18 2011-08-19 2011-08-20 2011-08-21 2011-08-22 2011-08-23 2011-08-24 2011-08-25 2011-08-26 2011-08-27 2011-08-28 2011-08-29 2011-08-30 2011-08-31 2011-09-01 2011-09-02 2011-09-03 2011-09-04 2011-09-05 2011-09-06 2011-09-07 2011-09-08 2011-09-09 2011-09-10 2011-09-11 2011-09-12 2011-09-13 2011-09-14 2011-09-15 2011-09-16 2011-09-17 2011-09-18 2011-09-19 2011-09-20 2011-09-21 2011-09-22 2011-09-23 2011-09-24 2011-09-25 2011-09-26 2011-09-27 2011-09-28 2011-09-29 2011-09-30 2011-10-01 2011-10-02 2011-10-03 2011-10-04 2011-10-05 2011-10-06 2011-10-07 2011-10-08 2011-10-09 2011-10-10 2011-10-11 2011-10-12 2011-10-13 2011-10-14 2011-10-15 2011-10-16 2011-10-17 2011-10-18 2011-10-19 2011-10-20 2011-10-21 2011-10-22 2011-10-23 2011-10-24 2011-10-25 2011-10-26 2011-10-27 2011-10-28 2011-10-29 2011-10-30 2011-10-31 2011-11-01 2011-11-02 2011-11-03 2011-11-04 2011-11-05 2011-11-06 2011-11-07 2011-11-08 2011-11-09 2011-11-10 2011-11-11 2011-11-12 2011-11-13 2011-11-14 2011-11-15 2011-11-16 2011-11-17 2011-11-18 2011-11-19 2011-11-20 2011-11-21 2011-11-22 2011-11-23 2011-11-24 2011-11-25 2011-11-26 2011-11-27 2011-11-28 2011-11-29 2011-11-30 2011-12-01 2011-12-02 2011-12-03 2011-12-04 2011-12-05 2011-12-06 2011-12-07 2011-12-08 2011-12-09 2011-12-10 2011-12-11 2011-12-12 2011-12-13 2011-12-14 2011-12-15 2011-12-16 2011-12-17 2011-12-18 2011-12-19 2011-12-20 2011-12-21 2011-12-22 2011-12-23 2011-12-24 2011-12-25 2011-12-26 2011-12-27 2011-12-28 2011-12-29 2011-12-30 2011-12-31 2012-01-01 2012-01-02 2012-01-03 2012-01-04 2012-01-05 2012-01-06 2012-01-07 2012-01-08 2012-01-09 2012-01-10 2012-01-11 2012-01-12 2012-01-13 2012-01-14 2012-01-15 2012-01-16 2012-01-17 2012-01-18 2012-01-19 2012-01-20 2012-01-21 2012-01-22 2012-01-23 2012-01-24 2012-01-25 2012-01-26 2012-01-27 2012-01-28 2012-01-29 2012-01-30 2012-01-31 2012-02-01 2012-02-02 2012-02-03 2012-02-04 2012-02-05 2012-02-06 2012-02-07 2012-02-08 2012-02-09 2012-02-10 2012-02-11 2012-02-12 2012-02-13 2012-02-14 2012-02-15 2012-02-16 2012-02-17 2012-02-18 2012-02-19 2012-02-20 2012-02-21 2012-02-22 2012-02-23 2012-02-24 2012-02-25 2012-02-26 2012-02-27 2012-02-28 2012-02-29 2012-03-01 2012-03-02 2012-03-03 2012-03-04 2012-03-05 2012-03-06 2012-03-07 2012-03-08 2012-03-09 2012-03-10 2012-03-11 2012-03-12 2012-03-13 2012-03-14 2012-03-15 2012-03-16 2012-03-17 2012-03-18 2012-03-19 2012-03-20 2012-03-21 2012-03-22 2012-03-23 2012-03-24 2012-03-25 2012-03-26 2012-03-27 2012-03-28 2012-03-29 2012-03-30 2012-03-31 2012-04-01 2012-04-02 2012-04-03 2012-04-04 2012-04-05 2012-04-06 2012-04-07 2012-04-08 2012-04-09 2012-04-10 2012-04-11 2012-04-12 2012-04-13 2012-04-14 2012-04-15 2012-04-16 2012-04-17 2012-04-18 2012-04-19 2012-04-20 2012-04-21 2012-04-22 2012-04-23 2012-04-24 2012-04-25 2012-04-26 2012-04-27 2012-04-28 2012-04-29 2012-04-30 2012-05-01 2012-05-02 2012-05-03 2012-05-04 2012-05-05 2012-05-10 2012-05-11 2012-05-14
780500 302000 49800 89000 11000 20000 43000 1599900 2468 1323250 116200 113800 132100 300400 111400 87900 67100 217800 40300 200800 80600 59300 208500 125300 49800 157800 140800 134100 86500 135300 600 2661400 5874000 249900 70000 132500 500 400 500 6330100 600 700 1100 1921000 391600 1200 1100 100 600 100 100 200 300 100 1000 100 4239600 30197400 18992000 2948700 301 1696103 5429200 381300 101 1 102 26199700 3886500 178005 3250602 4474500 2196802 3067950 37200500 21589750 8146300 6846600 16203100 28571300 33630200 42141100 59624100 27266300 37286000 16577200 36319900 50055300 21797100 34100200 13830600 17130200 2714300 1553000 1549000 2276500 3652500 4568600 10013800 12960400 11802800 12296000 12536300 15397500 22805600 21013700 50157100 44837600 38176000 64499200 70691300 30656800 16320800 27800700 35813600 35276700 85646700 84596400 40011900 41863400 67685250 89038100 105098400 265551700 50609700 88249500 59770600 51966900 98674600 140200100 196871100 90204400 83409700 84194700 95138200 73847300 56342200 76163000 195840200 44429600 62525800 16453600 48987900 59740300 100055600 172271100 64441000 70177800 79005200 111899300 123332775 270506600 315833900 107919270 85088200 100958600 145200100 103315000 247938800 302743220 94734300 92142300 92373000 22665800 28533900 31238200 22328400 38497500 34151600 44712000 27656100 18824900 32204237 31087500 36542012 32437606 26198042 41734593 23392903 40080820 46676300 44078703 59545500 36264403 30998727 61481800 115156430 196419300 96184806 86665421 87839503 71995000 117668900 118036100 163970200 173818900 63706320 85195400 42672310 49778700 132754730 202734600 43042000 71504300 78297800 77427700 106649400 172003400 166938900 88285900 107411300 115388300 166544750 96862600 117987200 142570600 64013600 63328300 94187000 78030400 74933300 169693200 155049700 71335700 83130110 95853800 74230300 99866920 193162500 191864000 86224200 79762300 56765100 53364000 65659072 144013900 191131900 60186100 68737700 62425300 94213700 81157400 246632600 243460300 90288800 105053100 133311800 201529900 101598000 131365200 158510800 91029700 94716700 102165499 89182300 116533000 121882000 220804300 96668900 83557600 132504200 130263254 135447400 263584950 331199300 179885200 239673800 289153800 188630000 130728400 201030700 233932750 149987200 255524200 144134900 154967300 174500000 340550000 396856600 189880100 151777900 187073279 217471000 195456993 57686500 134915600 79132291 105666735 165171567 103127800 126394063 379471770 298140407 126937444 129604759 180424693 232361307 201754441 324248900 385765100 200729800 149746200 211085627 223014200 299599353 522776634 468751600 267930366 247832000 305086286 327506339 188490759 458969608 507824336 192818550 188283631 279183308 295078473 269126750 547294005 585219645 345355941 340133010 361816806 287178420 203064285 366816967 400216885 370562547 341314305 363736067 327588868 424946254 1204219391 477885557 419295781 288932941 244871201 264847247 313804388 418101452 733951047 370202002 327729423 349198618 267203140 375270188 775740614 737594085 401623441 290304265 294565023 304745340 291692509 466257310 543738127 222507897 231005774 282942829 749112596 324023297 596835869 503435314 299036613 283060853 369414444 313934822 358165685 572646131 697430123 319509354 268084902 274447215 401810006 311125373 644650664 613163909 425283271 501240371 306465704 324927715 407127644 616233441 593810338 370228177 271732315 301096748 302013214 296354305 611530259 500861084 284187676 252285428 314638856 320890615 369126464 650030757 627094377 308860057 292062941 302659230 314022064 323138837 524167730 309229819 270118365 244290056 326191834 247683995 320270224 638401746 687503637 349165641 314298378 305748385 343644504 570118196 692073559 596987698 319365161 316392907 287693296 389620456 428593976 765964578 854735900 406284894 351144581 513007971 502529992 655503107 820676428 717436477 456198026 446996030 518214727 475646211 714686031 1020537273 901752248 523600696 474267605 509937651 424668047 531824488 958961423 1127224504 575432115 884153887 592440716 557717294 659786139 1067815690 1007083983 703222250 1172879709 590948022 675771970 790843538 1337953851 10300200 8972506 3542725sorry for my poor english and let me know for any further clearance if needed , i despiratly looking for all your kind assistance.
Regards
Regards, Shanu
All Replies
-
Thursday, June 14, 2012 1:53 PM
hello,
I think the misbehaviour comes from the fact that you don't have some members in your dimension.
For example when you refer to [V Dim Time].[Date Only].[2012-05-13] it search for member 2012-05-13, but you don't have this member on your dimension.
Hence, when you refer to existing members the query return expected results, when you refer to non existing members the query return wrong results.
HTH
Bye
Norman
- Marked As Answer by Shanu_Shri Friday, June 15, 2012 11:00 AM
-
Friday, June 15, 2012 6:25 AM
hi Norman,
As per your guidance i cross check my [V Dim Time] dimension with Fact table and i found that there is no Fact without V_DimTime member.
SELECT F.*
FROM V_DimTime D
RIGHT JOIN V_FactTransaction F
ON D.FullDateKey = F.FullDateKey
WHERE D.FullDateKey IS NULL---output
No Rowsnow when the relation is fine then why we are getting problem in few date ranges, Plz Assist
Regards, Shanu
- Edited by Shanu_Shri Friday, June 15, 2012 6:26 AM
-
Friday, June 15, 2012 7:21 AM
i tried to narrow down the problem here and found that
---Find Transaction Amount of All Acquirers for Date '2012-05-13'
SELECT {[Measures].[Transaction Amount]} ON COLUMNS,
topcount([V Dim Acquirer].[Acquirer Name].[Acquirer Name],10,[Measures].[Transaction Amount]) on rows
FROM (SELECT {strtomember('[V Dim Time].[Date Only].[2012-05-13]')} ON COLUMNS
FROM TRMLIVE )------------
OUTPUT is Accurate
---Find Transaction Amount of All Acquirers for Date '2012-05-14'
SELECT {[Measures].[Transaction Amount]} ON COLUMNS,
topcount([V Dim Acquirer].[Acquirer Name].[Acquirer Name],10,[Measures].[Transaction Amount]) on rows
FROM (SELECT {strtomember('[V Dim Time].[Date Only].[2012-05-14]')} ON COLUMNS
FROM TRMLIVE )------------
OUTPUT is Accurate
--Find Transaction Amount of All Acquirers between Date '2012-05-13' to '2012-05-14'
SELECT {[Measures].[Transaction Amount]} ON COLUMNS,
topcount([V Dim Acquirer].[Acquirer Name].[Acquirer Name],10,[Measures].[Transaction Amount]) on rows
FROM (SELECT {strtomember('[V Dim Time].[Date Only].[2012-05-13]'):strtomember('[V Dim Time].[Date Only].[2012-05-14]')} ON COLUMNS
FROM TRMLIVE )--output is wrong -- (Calculating sum of till date Transaction Amount for few Acquirers and for few Acquirer there is null)
Transaction Amount
HDFC 61815526971
CITIBANK 19126483088
AXIS 7521798031
ICICI 5577155993
AMEX 1804454807
IDBI 1296258849
CORP BANK 20408150
AIRTEL-MONEY 800
COD (null)
CUB (null)
Regards, Shanu
Regards, Shanu
-
Friday, June 15, 2012 11:02 AM
Hi Norman i reanalyze the scenario and found that there is not date for "2012-05-13" is available in my Dimension. so in any query where this perticular date is included retrieving the wrong data.
many thanks again for your kind favor :)
Regards, Shanu

