Can anyone explain what is the difference in using filter() and Where in MDX queries?
I am trying to create MDX queries using the OLAP4j query model and I am confused as to when to use filter() and when to use Where clause.
Can anyone explain what is the difference in using filter() and Where in MDX queries?
I am trying to create MDX queries using the OLAP4j query model and I am confused as to when to use filter() and when to use Where clause.
Copyright © 2021 Jogjafile Inc.
The FILTER() function is used to apply a condition to a set or a sub set of data within the cube and return only those members that fulfill the specified condition. It is often used as a filter member of the dimensions in the MDX query body under some criteria.
It is also versatile and can be used to dynamically filter the members based on the measures or other member properties.
When is it useful?
For example, when you want to use complex conditions, and when the filtering criteria cannot be directly expressed in the WHERE clause or through slice-and-dice operations.
On the other hand, WHERE is used to slice the cube by specifying a point in the multidimensional space. In other words, it filters the cube to a specific context or a set of contexts, limiting the query scope to that context.
https://learn.microsoft.com/en-us/analysis-services/multidimensional-models/mdx/mdx-query-and-slicer-axes-specify-the-contents-of-a-slicer-axis?view=asallproducts-allversions
When is it useful ?
When you want to specify a particular slice of the cube that you want to focus on.