dbTalk Databases Forums  

Can't suppress rows with zero values

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Can't suppress rows with zero values in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Burt
 
Posts: n/a

Default Can't suppress rows with zero values - 07-21-2004 , 02:17 PM






I'm using MDX and Reporting Services to bring back data from a cube. I
want to suppress any data where Measure.B is null or 0, but nothing I
try works. For example, the MDX below returns many rows where
Measure.B=0:

SELECT NON EMPTY filter(nonemptycrossjoin({[Period].[200407]},
{Measures.B}), measures.b>0) ON COLUMNS, NON EMPTY
{[PS_OF_RK_TK].AllMembers} ON ROWS FROM HoursReport

Can anyone help? PS_OF_RK_TK is a dimension with four levels, Section,
Office, Rank, and Timekeeper.

The actual MDX has many measures (this is a simplified version), so
I'm hoping there's a way to suppress the whole row if all
measures=null or 0, without having to operate on each measure, though
even that would be a start.

Thanks,

Burt

Reply With Quote
  #2  
Old   
Burt
 
Posts: n/a

Default Re: Can't suppress rows with zero values - 07-22-2004 , 07:20 PM






Jamie,

Thanks much for the help. You're right- I did need filter on the
[PS_OF_RK_TK] dimension. But I did some testing and unfortunately
there is an additional issue.

Measure B is a calculated member. If I set its expression as:

IIF(Measures.Apbw<20,(Measures.Apbw),0)

in my cube, my filter function works. But if I simply change the <>
operator to:

IIF(Measures.Apbw>20,(Measures.Apbw),0)

my MDX totally ignores the filter function and returns all rows. I can
think of no reason the <> operator would break my filter. The server
also returns an error the first time I execute the MDX after
processing the cube with the > sign, but then works (but no filter) on
subsequent tries. Maybe this will all work in Yukon...

Burt







"Jamie" <Jamie (AT) discussions (DOT) microsoft.com> wrote

Quote:
I think you want to filter members from the [PS_OF_RK_TK] dimension. Is that correct? Which level do you want to filter?

Try this:
SELECT
([Period].[200407], [Measures].[b]) ON COLUMNS,
FILTER(
{[PS_OF_RK_TK].<level_name>.members},
( ([PS_OF_RK_TK].CurrentMember, [Measures].[b]) <> 0 OR ([PS_OF_RK_TK].CurrentMember, [Measures].[b]) IS NOT NULL )
)
ON ROWS
FROM HoursReport

Regards
Jamie



"Burt" wrote:

I'm using MDX and Reporting Services to bring back data from a cube. I
want to suppress any data where Measure.B is null or 0, but nothing I
try works. For example, the MDX below returns many rows where
Measure.B=0:

SELECT NON EMPTY filter(nonemptycrossjoin({[Period].[200407]},
{Measures.B}), measures.b>0) ON COLUMNS, NON EMPTY
{[PS_OF_RK_TK].AllMembers} ON ROWS FROM HoursReport

Can anyone help? PS_OF_RK_TK is a dimension with four levels, Section,
Office, Rank, and Timekeeper.

The actual MDX has many measures (this is a simplified version), so
I'm hoping there's a way to suppress the whole row if all
measures=null or 0, without having to operate on each measure, though
even that would be a start.

Thanks,

Burt


Reply With Quote
  #3  
Old   
Jamie
 
Posts: n/a

Default Re: Can't suppress rows with zero values - 07-23-2004 , 03:21 AM



The reason is returns everthing is because the logic behind what I posted is:
Return the member IF:
(1) It is not zero OR
(2) It is not NULL

Anyting forced to zero will get caught by (2). Everything else will get caught by (1)

Regards
Jamie


"Burt" wrote:

Quote:
Jamie,

Thanks much for the help. You're right- I did need filter on the
[PS_OF_RK_TK] dimension. But I did some testing and unfortunately
there is an additional issue.

Measure B is a calculated member. If I set its expression as:

IIF(Measures.Apbw<20,(Measures.Apbw),0)

in my cube, my filter function works. But if I simply change the
operator to:

IIF(Measures.Apbw>20,(Measures.Apbw),0)

my MDX totally ignores the filter function and returns all rows. I can
think of no reason the <> operator would break my filter. The server
also returns an error the first time I execute the MDX after
processing the cube with the > sign, but then works (but no filter) on
subsequent tries. Maybe this will all work in Yukon...

Burt







"Jamie" <Jamie (AT) discussions (DOT) microsoft.com> wrote

I think you want to filter members from the [PS_OF_RK_TK] dimension. Is that correct? Which level do you want to filter?

Try this:
SELECT
([Period].[200407], [Measures].[b]) ON COLUMNS,
FILTER(
{[PS_OF_RK_TK].<level_name>.members},
( ([PS_OF_RK_TK].CurrentMember, [Measures].[b]) <> 0 OR ([PS_OF_RK_TK].CurrentMember, [Measures].[b]) IS NOT NULL )
)
ON ROWS
FROM HoursReport

Regards
Jamie



"Burt" wrote:

I'm using MDX and Reporting Services to bring back data from a cube. I
want to suppress any data where Measure.B is null or 0, but nothing I
try works. For example, the MDX below returns many rows where
Measure.B=0:

SELECT NON EMPTY filter(nonemptycrossjoin({[Period].[200407]},
{Measures.B}), measures.b>0) ON COLUMNS, NON EMPTY
{[PS_OF_RK_TK].AllMembers} ON ROWS FROM HoursReport

Can anyone help? PS_OF_RK_TK is a dimension with four levels, Section,
Office, Rank, and Timekeeper.

The actual MDX has many measures (this is a simplified version), so
I'm hoping there's a way to suppress the whole row if all
measures=null or 0, without having to operate on each measure, though
even that would be a start.

Thanks,

Burt



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.