![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
| ([Volume Hierarchy].[Petrols], |
#3
| |||
| |||
|
|
Hi Trevor, Maybe by computing the average (sum/count) explicitly, rather than using Avg(), you can leverage the pre-aggregated sum of the Petrol qty measure: ([Volume Hierarchy].[Petrols], [Measures].[Purchases (Qty)]) / Iif ([Time Month].[Calendar].Currentmember is [Time Month].[Calendar].Defaultmember, Count(NonEmptyCrossJoin(Descendants( [Time Month].[Financial].CurrentMember, [Time Month].[Financial].[Month]), Descendants([Site].CurrentMember, [Site].[Site]))), Count(NonEmptyCrossJoin(Descendants( [Time Month].[Calendar].CurrentMember, [Time Month].[Calendar].[Month]), Descendants([Site].CurrentMember, [Site].[Site])))) - Deepak Deepak Puri Microsoft MVP - SQL Server *** Sent via Developersdex http://www.developersdex.com *** |
#4
| |||
| |||
|
|
Hi Deepak Thanks for your reply. I tried your new mdx expression against the original and found that it was slower than the original. The original takes 13 seconds from when you drop the field onto the OWC page and the new one takes 22 seconds. Also the two mdx strings yield different results. Any other suggestions? "Deepak Puri" wrote: Hi Trevor, Maybe by computing the average (sum/count) explicitly, rather than using Avg(), you can leverage the pre-aggregated sum of the Petrol qty measure: ([Volume Hierarchy].[Petrols], [Measures].[Purchases (Qty)]) / Iif ([Time Month].[Calendar].Currentmember is [Time Month].[Calendar].Defaultmember, Count(NonEmptyCrossJoin(Descendants( [Time Month].[Financial].CurrentMember, [Time Month].[Financial].[Month]), Descendants([Site].CurrentMember, [Site].[Site]))), Count(NonEmptyCrossJoin(Descendants( [Time Month].[Calendar].CurrentMember, [Time Month].[Calendar].[Month]), Descendants([Site].CurrentMember, [Site].[Site])))) - Deepak Deepak Puri Microsoft MVP - SQL Server *** Sent via Developersdex http://www.developersdex.com *** |
#5
| |||
| |||
|
|
if you have 1 row by month / site, why you don't use a simple count measure? month 1 / site 1 / count=1 month 1 / site 2 / count=1 month 2 / site 1 / count=1 month 2 / site 3 / count=1 this is exactly the same as your dcount formula (count of nonemptycrossjoin) but this measure is aggregated. I presume that the fiscal month is the same as your month (I mean january = january; but not the quarters and years) "Trevor Howe" <TrevorHowe (AT) discussions (DOT) microsoft.com> wrote in message news:910D16AA-89F5-4A7E-A6CD-E59FC5DA8612 (AT) microsoft (DOT) com... Hi Deepak Thanks for your reply. I tried your new mdx expression against the original and found that it was slower than the original. The original takes 13 seconds from when you drop the field onto the OWC page and the new one takes 22 seconds. Also the two mdx strings yield different results. Any other suggestions? "Deepak Puri" wrote: Hi Trevor, Maybe by computing the average (sum/count) explicitly, rather than using Avg(), you can leverage the pre-aggregated sum of the Petrol qty measure: ([Volume Hierarchy].[Petrols], [Measures].[Purchases (Qty)]) / Iif ([Time Month].[Calendar].Currentmember is [Time Month].[Calendar].Defaultmember, Count(NonEmptyCrossJoin(Descendants( [Time Month].[Financial].CurrentMember, [Time Month].[Financial].[Month]), Descendants([Site].CurrentMember, [Site].[Site]))), Count(NonEmptyCrossJoin(Descendants( [Time Month].[Calendar].CurrentMember, [Time Month].[Calendar].[Month]), Descendants([Site].CurrentMember, [Site].[Site])))) - Deepak Deepak Puri Microsoft MVP - SQL Server *** Sent via Developersdex http://www.developersdex.com *** |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
Unfortunately, my grain is not at the site level, so I cannot do a normal count and distinct count has its own related issues (most frustrating of all being the inability to multi select dimensions - cant wait for SQL 2005 to make its appearance in our organisation). The fiscal year is an alternate calendar representing the organisations fiscal period being March to Febrary and yes, at the month level both fiscal and calendar month are the same, but not at quarter and year level. "Jéjé" wrote: if you have 1 row by month / site, why you don't use a simple count measure? month 1 / site 1 / count=1 month 1 / site 2 / count=1 month 2 / site 1 / count=1 month 2 / site 3 / count=1 this is exactly the same as your dcount formula (count of nonemptycrossjoin) but this measure is aggregated. I presume that the fiscal month is the same as your month (I mean january = january; but not the quarters and years) "Trevor Howe" <TrevorHowe (AT) discussions (DOT) microsoft.com> wrote in message news:910D16AA-89F5-4A7E-A6CD-E59FC5DA8612 (AT) microsoft (DOT) com... Hi Deepak Thanks for your reply. I tried your new mdx expression against the original and found that it was slower than the original. The original takes 13 seconds from when you drop the field onto the OWC page and the new one takes 22 seconds. Also the two mdx strings yield different results. Any other suggestions? "Deepak Puri" wrote: Hi Trevor, Maybe by computing the average (sum/count) explicitly, rather than using Avg(), you can leverage the pre-aggregated sum of the Petrol qty measure: ([Volume Hierarchy].[Petrols], [Measures].[Purchases (Qty)]) / Iif ([Time Month].[Calendar].Currentmember is [Time Month].[Calendar].Defaultmember, Count(NonEmptyCrossJoin(Descendants( [Time Month].[Financial].CurrentMember, [Time Month].[Financial].[Month]), Descendants([Site].CurrentMember, [Site].[Site]))), Count(NonEmptyCrossJoin(Descendants( [Time Month].[Calendar].CurrentMember, [Time Month].[Calendar].[Month]), Descendants([Site].CurrentMember, [Site].[Site])))) - Deepak Deepak Puri Microsoft MVP - SQL Server *** Sent via Developersdex http://www.developersdex.com *** |
![]() |
| Thread Tools | |
| Display Modes | |
| |