pythonlearner
pythonlearner

Reputation: 105

MDX Query: How to use where condition in query using filter()

Need Suggestions for below mdx query. It's giving syntax error. trying to calculate total sales where pop2019 larger than 5000 & GDPgrowth more than 1

Schema link

SELECT
{[Measures].[Sales]} ON 0,
{[Dim Company Info].[LOC].ALLMEMBERS} ON 1
FROM [Database] where (filter ([Dim Company Info].[Loc].members],[Measures].[pop19]>5000, [dim company info].[loc].members,[measures].[gdp growth]>1)

Upvotes: 1

Views: 61

Answers (1)

MoazRub
MoazRub

Reputation: 2911

Make the corrections to your query

SELECT {[Measures].[Sales]} ON 0, {[Dim Company Info].[LOC].ALLMEMBERS} ON 1 FROM [Database] where (filter ([Dim Company Info].[Loc].members],[Measures].[pop19]>5000, [dim company info].[loc].members,[measures].[gdp growth]>1)

SELECT
{[Measures].[Sales]} ON 0,
{
filter([Dim Company Info].[LOC].ALLMEMBERS,[Measures].[pop19]>5000 and [measures].[gdp growth]>1)
}

ON 1
FROM [Database] 

Upvotes: 1

Related Questions