0
votes

The first query works as I needed. But when I tried to rewrite in terms of a calculated member to put it in my cube, It crashed.

select non empty [Measures].[Demanda Real] on 0,
non empty [Agente Distribuidor].[Nombre Distribuidor].[Nombre Distribuidor].members on 1
from Demanda
where [SkSubmercadoUsuario]

First MDX query results

This is my failed try:

with member [Measures].[Demanda Real Dos] 
as
([Measures].[Demanda Real], [SkSubmercadoUsuario])
select [Measures].[Demanda Real Dos]  on 0,
non empty [Agente Distribuidor].[Nombre Distribuidor].[Nombre Distribuidor].members on 1
from Demanda

What I need is slice my cube by [SkSubmercadoUsuario], but it cannot be by a where clause. I need to create a measure that slices the measure by this Named Set [SkSubmercadoUsuario]

2

2 Answers

0
votes

I'm not sure to understand what you're trying to do. Do you just want to create a second measure [Measures].[Demanda Real] renamed as [Measures].[Demanda Real Dos] in your query or do you want to create your measure in the "calculation script part" of your cube ? In the first case, I think you don't need to move the condition part. Try this :

with member [Measures].[Demanda Real Dos] 
as
([Measures].[Demanda Real])
select [Measures].[Demanda Real Dos]  on 0,
non empty [Agente Distribuidor].[Nombre Distribuidor].[Nombre Distribuidor].members on 1
from Demanda
where [SkSubmercadoUsuario]
0
votes

May be you need to do something like this

with member [Measures].[Demanda Real Dos] 
as
SUM({[Sk Submercado Usuario].&[52], [Sk Submercado Usuario].&[622]}, 
     [Measures].[Demanda Real] )

select [Measures].[Demanda Real Dos]  on 0,
non empty [Agente Distribuidor].[Nombre Distribuidor].[Nombre Distribuidor].members on 1
from Demanda