Quantcast
Channel: SQLServerCentral » Data Warehousing » Analysis Services » Latest topics
Viewing all articles
Browse latest Browse all 1341

EXISTS not returning the same number of rows as WHERE

$
0
0
Hi,I am trying to write this MDX query. I am trying to select the Number of planned jobs (open, closed) by the customer name Acme.If I do this in the WHERE clause I get the correct figures for Acme. However if I use EXISTS it seems to ignore the customer filter 'Acme' and gets the figures for all customers.The thing is I don't want to do it in the WHERE clause as eventually I will be adding a named set into the filter for DatePeriod and I cannot add it in the WHERE clause. Has anyone got any ideas please?WITH //--params//--test SET [VarPeriod] AS PeriodsToDate([KPI Planned Date].[Calendar].[Calendar Year],STRTOMEMBER("[KPI Planned Date].[Calendar].[Calendar Month].&["+Format(now(), "yyyyMM")+"]"))SET [VarCustomer] AS [Customer].[Customer Ref].&[Acme]//SELECT[Measures].[Number of Planned Jobs] on Columns,//non empty//(EXISTS([Job Status].[Job Status Type].[Job Status Type].Members,[Customer].[Customer Ref].&[Acme])////)--[Job Status].[Job Status Type].[Job Status Type]on Rowsfrom [TestCube]--where --(--[Customer].[Customer Ref].&[Acme]--)

Viewing all articles
Browse latest Browse all 1341

Trending Articles