Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MDX Query filter column with value greater than zero

Posted on 2011-02-22
6
Medium Priority
?
3,308 Views
Last Modified: 2012-05-11
I have this query

Select  
{[Buckets].[Header].[AGHeader]} on columns
,

Filter(
{[Account].[Accounts Name].[Name]} ,
([Measures].[Summary_Value]>0)
) ON ROWS


from capa
Where  [Buckets].[Type].&[AR]


which produces output similar to

-----------  Col1 col2 col3

ABC CO      1      0      1
BCE Co       2      0      2
HEO CO      3      1     2


I need to filter so results only contain the rows where col2 has a value greater than zero.

I am new to mdx so not sure what other info I need to provide.

0
Comment
Question by:JonMny
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 15

Accepted Solution

by:
derekkromm earned 1000 total points
ID: 34957630
Is AGHeader a named set? I tried basically an identical select on one of my dbs and it filtered as expected.

What if you try this:

Select  
{[Buckets].[Header].[AGHeader],[Measures].[Summary_Value]} on columns,

Filter(
{[Account].[Accounts Name].[Name]} ,
([Measures].[Summary_Value]>0)
) ON ROWS


from capa
Where  [Buckets].[Type].&[AR]
0
 
LVL 9

Author Comment

by:JonMny
ID: 34962324
no not a named set,

The query seems to filter values that are zero but It's not quite what I need

I need to show all agheaders  and value for a specific account but filter to only the times when col2 has a zero value. the other columns can have a zero.




0
 
LVL 10

Expert Comment

by:itcouple
ID: 34964263
Hi

Might be worth posting entire query. The syntax you used is correct. Just ensure you use the correct measures that generates values for column 2.

Regards
Emil
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 9

Author Comment

by:JonMny
ID: 34964703
I will try to create a more complete example.


here is a what i want to due but of course doesnt work.

from capa
Where  [Buckets].[Type].&[AR]
and
( [Buckets].[AgingHeader].&[52] and [Measures].[Invoice_Amount]>0)


0
 
LVL 10

Assisted Solution

by:itcouple
itcouple earned 1000 total points
ID: 34964781
Hi

Is that the complete query?

Using where may produce unexpected results with MDX. use [Measures].[Invoice_Amount]>0) using filter on rows.

If you know T-SQL (like me) then forget about it!! It will be much easier :)

Regards
Emil

0
 
LVL 9

Author Comment

by:JonMny
ID: 34981603
The issue I am having is that all three columns are tied to the invoice_amount. So if I filter invoice amount> 0 I end up filtering columns that I need.


0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question