dbTalk Databases Forums  

How to suppress zeroes rows or columns using Select MDX?

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


Discuss How to suppress zeroes rows or columns using Select MDX? in the microsoft.public.sqlserver.olap forum.



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

Default How to suppress zeroes rows or columns using Select MDX? - 10-09-2003 , 08:40 PM






Hi There,
I have used the SELECT NON EMPTY ON ROWS or COLUMNS, but
this only suppress empty rows or columns. Zeroes rows or
columns are still returned.

Is there a MDX function to exclude rows or columns if it
has all zeroes?

Thanks,
Dao.

Reply With Quote
  #2  
Old   
Tom Chester
 
Posts: n/a

Default Re: How to suppress zeroes rows or columns using Select MDX? - 10-09-2003 , 09:11 PM






Not exactly. However you can use the Filter function to filter a set, like
this foodmart example...

Filter( [Store Name].Members, [Store Sales] <>0 )

tom @ the domain below
www.tomchester.net

"Dao Tring" <dao.trinh (AT) solution6 (DOT) com> wrote

Quote:
Hi There,
I have used the SELECT NON EMPTY ON ROWS or COLUMNS, but
this only suppress empty rows or columns. Zeroes rows or
columns are still returned.

Is there a MDX function to exclude rows or columns if it
has all zeroes?

Thanks,
Dao.



Reply With Quote
  #3  
Old   
Dao Trinh
 
Posts: n/a

Default Re: How to suppress zeroes rows or columns using Select MDX? - 10-09-2003 , 09:23 PM



Appreciate for a quick reply. It helps.
The filter does help me to suppress zeroes rows. I think I
need to check the column cellset to exclude zeroes columns.
Thanks,
Dao
Quote:
-----Original Message-----
Not exactly. However you can use the Filter function to
filter a set, like
this foodmart example...

Filter( [Store Name].Members, [Store Sales] <>0 )

tom @ the domain below
www.tomchester.net

"Dao Tring" <dao.trinh (AT) solution6 (DOT) com> wrote in message
news:26e4a01c38ecf$6cf86b20$a601280a (AT) phx (DOT) gbl...
Hi There,
I have used the SELECT NON EMPTY ON ROWS or COLUMNS, but
this only suppress empty rows or columns. Zeroes rows or
columns are still returned.

Is there a MDX function to exclude rows or columns if it
has all zeroes?

Thanks,
Dao.


.


Reply With Quote
  #4  
Old   
Mosha Pasumansky [MS]
 
Posts: n/a

Default Re: How to suppress zeroes rows or columns using Select MDX? - 10-09-2003 , 09:26 PM



"Dao Tring" <dao.trinh (AT) solution6 (DOT) com> wrote

Quote:
Hi There,
I have used the SELECT NON EMPTY ON ROWS or COLUMNS, but
this only suppress empty rows or columns. Zeroes rows or
columns are still returned.

Is there a MDX function to exclude rows or columns if it
has all zeroes?
One technique is to put calculated cell over entire cube which converts
zeros to NULLs, i.e.

WITH CELL CALULATION ZerosToNULL FOR '(Measures.ALLMEMBERS)' AS
'IIF(Measures.CurrentMember.Value = 0, NULL,
CalculationPassValue(Measures.CurrentMember, -1, RELATIVE)'
SELECT NON EMPTY ...

--
==================================================
Mosha Pasumansky - www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==================================================




Reply With Quote
  #5  
Old   
Dao Trinh
 
Posts: n/a

Default Re: How to suppress zeroes rows or columns using Select MDX? - 10-09-2003 , 09:51 PM



Hi Mosha,
Thanks for your help but I have problem execute the MDX
WITH CELL CALCULATION ZerosToNULL
FOR '(Measures.ALLMEMBERS)' AS
'IIF(Measures.CurrentMember = 0, NULL,CalculationPassValue
(Measures.CurrentMember, -1, RELATIVE)'
SELECT NON EMPTY { [Measures].[Net Fees Earned Ytd],
[Measures].[Bud Net Fees Earned Ytd], [Measures].[Gross
Contribution Mtd] } ON COLUMNS,
{ Descendants ( [Matter Resp Partner].[All Partner].
[Accounting Departments], 1 , SELF_AND_BEFORE) } ON ROWS
From [Matter Responsible Partner Performance] WHERE
([Currency Type].[Global : USD], [Industry].[All
Industry], [Matter].[All Matter], [Period].[All Period].
[2003].[2003 - 03])

The error is "unable open cellset - Formula error,
expected end of expression Formula member name ZerosToNULL
is not valid.

Thanks,
Dao.
Quote:
-----Original Message-----
"Dao Tring" <dao.trinh (AT) solution6 (DOT) com> wrote in message
news:26e4a01c38ecf$6cf86b20$a601280a (AT) phx (DOT) gbl...
Hi There,
I have used the SELECT NON EMPTY ON ROWS or COLUMNS, but
this only suppress empty rows or columns. Zeroes rows or
columns are still returned.

Is there a MDX function to exclude rows or columns if it
has all zeroes?

One technique is to put calculated cell over entire cube
which converts
zeros to NULLs, i.e.

WITH CELL CALULATION ZerosToNULL
FOR '(Measures.ALLMEMBERS)' AS
'IIF(Measures.CurrentMember.Value = 0, NULL,
CalculationPassValue(Measures.CurrentMember, -1,
RELATIVE)'
SELECT NON EMPTY ...

--
==================================================
Mosha Pasumansky - www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no
warranties, and
confers no rights.
==================================================


.


Reply With Quote
  #6  
Old   
Mosha Pasumansky [MS]
 
Posts: n/a

Default Re: How to suppress zeroes rows or columns using Select MDX? - 10-09-2003 , 09:54 PM



"Dao Trinh" <dao.trinh (AT) solution6 (DOT) com> wrote

Quote:
Hi Mosha,
Thanks for your help but I have problem execute the MDX
I think I forgot to close one parethesis - here is the updated version

WITH CELL CALULATION ZerosToNULL FOR '(Measures.ALLMEMBERS)' AS
'IIF(Measures.CurrentMember.Value = 0, NULL,
CalculationPassValue(Measures.CurrentMember, -1, RELATIVE))'


--
==================================================
Mosha Pasumansky - www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==================================================




Reply With Quote
  #7  
Old   
Dao Trinh
 
Posts: n/a

Default Re: How to suppress zeroes rows or columns using Select MDX? - 10-09-2003 , 10:12 PM



Hi Mosha,
It still complains about the Value, ie.
Measures.CurrentMember.^Value^ is an inavalid token.

If I remove the value I can execute the MDX, but it
returns #ERR

Thanks,
Dao.
Quote:
-----Original Message-----
"Dao Trinh" <dao.trinh (AT) solution6 (DOT) com> wrote in message
news:087801c38ed9$689f65b0$a401280a (AT) phx (DOT) gbl...
Hi Mosha,
Thanks for your help but I have problem execute the MDX

I think I forgot to close one parethesis - here is the
updated version

WITH CELL CALULATION ZerosToNULL
FOR '(Measures.ALLMEMBERS)' AS
'IIF(Measures.CurrentMember.Value = 0, NULL,
CalculationPassValue(Measures.CurrentMember, -1,
RELATIVE))'


--
==================================================
Mosha Pasumansky - www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no
warranties, and
confers no rights.
==================================================


.


Reply With Quote
  #8  
Old   
Mosha Pasumansky [MS]
 
Posts: n/a

Default Re: How to suppress zeroes rows or columns using Select MDX? - 10-10-2003 , 02:35 AM



"Dao Trinh" <dao.trinh (AT) solution6 (DOT) com> wrote

Quote:
Hi Mosha,
It still complains about the Value, ie.
Measures.CurrentMember.^Value^ is an inavalid token.

If I remove the value I can execute the MDX, but it
returns #ERR
OK - here is the one that worked for me

WITH CELL CALCULATION ZerosToNULL FOR '(Measures.ALLMEMBERS)' AS
'IIF(CalculationPassValue(Measures.CurrentMember, -1, RELATIVE) = 0, NULL,
CalculationPassValue(Measures.CurrentMember, -1, RELATIVE))'

--
==================================================
Mosha Pasumansky - www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==================================================




Reply With Quote
  #9  
Old   
Dao Trinh
 
Posts: n/a

Default Re: How to suppress zeroes rows or columns using Select MDX? - 10-10-2003 , 03:15 AM



Thanks muchly for your help and your patience. It works!
Regards,
Dao.
Quote:
-----Original Message-----
"Dao Trinh" <dao.trinh (AT) solution6 (DOT) com> wrote in message
news:0a7401c38edc$649ff620$a101280a (AT) phx (DOT) gbl...
Hi Mosha,
It still complains about the Value, ie.
Measures.CurrentMember.^Value^ is an inavalid token.

If I remove the value I can execute the MDX, but it
returns #ERR

OK - here is the one that worked for me

WITH CELL CALCULATION ZerosToNULL
FOR '(Measures.ALLMEMBERS)' AS
'IIF(CalculationPassValue(Measures.CurrentMember, -1,
RELATIVE) = 0, NULL,
CalculationPassValue(Measures.CurrentMember, -1,
RELATIVE))'

--
==================================================
Mosha Pasumansky - www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no
warranties, and
confers no rights.
==================================================


.


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.