dbTalk Databases Forums  

calculation in analysis services

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


Discuss calculation in analysis services in the microsoft.public.sqlserver.olap forum.



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

Default calculation in analysis services - 08-09-2006 , 05:48 AM






filter({[Measures].[PPQ Count]},[Patient Stay].[PPQ Answer ID] <> 0)
---- this is a calculation in Analysis Service

PPQ Answer ID has a range from 0-4 and I'd like only those values which
are not 0.

PPQ Count is a measure where PPQ Answer ID is summed up


Unfortunately the Calculation doesn't work and shows the following
error msg.: function expects a string or a numeric but instead it gets
a tupel as an argument

anybody knows how to solve this.

backgroung is I#d like to calculate an average with all PPQ Answer IDs
which are not 0.

Thanks


Reply With Quote
  #2  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: calculation in analysis services - 08-09-2006 , 07:56 AM






There are a couple of problems with your filter statment, rather than go
into them - there is probably a better approach than using FILTER(),
which is to directly sum up the required values from the PPQ Answer ID
attribute.

You could either do this inclusively by adding up id's 1 to 4. (I am
assuming here that the ID is the key value for the attribute)

eg.

SUM({[Patient Stay].[PPQ Answer ID].&[1]:[Patient Stay].[PPQ Answer ID].
&[4]} ,[Measures].[PPQ Count])


But probably a more robust approach is to set the calculation up the
same way that you phrased the logic ie. get all the members except for
ID 0.

eg.

SUM(EXCEPT([Patient Stay].[PPQ Answer ID].[PPQ Answer ID].Members,
[Patient Stay].[PPQ Answer ID].&[0]) ,[Measures].[PPQ Count])



--
Regards
Darren Gosbell - SQL Server MVP
Blog: http://www.geekswithblogs.net/darrengosbell

In article <1155120521.449436.289770 (AT) i42g2000cwa (DOT) googlegroups.com>,
florian.stammer (AT) gmail (DOT) com says...
Quote:
filter({[Measures].[PPQ Count]},[Patient Stay].[PPQ Answer ID] <> 0)
---- this is a calculation in Analysis Service

PPQ Answer ID has a range from 0-4 and I'd like only those values which
are not 0.

PPQ Count is a measure where PPQ Answer ID is summed up


Unfortunately the Calculation doesn't work and shows the following
error msg.: function expects a string or a numeric but instead it gets
a tupel as an argument

anybody knows how to solve this.

backgroung is I#d like to calculate an average with all PPQ Answer IDs
which are not 0.

Thanks




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

Default Re: calculation in analysis services - 08-09-2006 , 08:50 AM



hi,

thanks for your help.

I tried:SUM(EXCEPT([Patient Stay].[PPQ Answer ID].[PPQ Answer
ID].Members, [Patient Stay].[PPQ Answer ID].&[0]) ,[Measures].[PPQ
Count])

but I got hierachie [PPQ Answer ID] was not found in the cube when
analysing the string [Patient Stay].[PPQ Answer ID].[PPQ Answer ID]

then I tried SUM(EXCEPT([Patient Stay].[PPQ Answer ID].Members,
[Patient Stay].[PPQ Answer ID].&[0]) ,[Measures].[PPQ Count])

but I got hierachie [PPQ Answer ID] was not found in the cube.

But maybe there is another way of solving my problem to get my
calculation right - I'll only need the correct [PPQ Count] the the one
without any PPQ Answer IDs who are 0. Isn't there an easy way to update
this in the properties window of the [PPQ Count] Measure - now only the
aggregate function is set to count - I would need count without 0.

Thanks



Darren Gosbell schrieb:

Quote:
There are a couple of problems with your filter statment, rather than go
into them - there is probably a better approach than using FILTER(),
which is to directly sum up the required values from the PPQ Answer ID
attribute.

You could either do this inclusively by adding up id's 1 to 4. (I am
assuming here that the ID is the key value for the attribute)

eg.

SUM({[Patient Stay].[PPQ Answer ID].&[1]:[Patient Stay].[PPQ Answer ID].
&[4]} ,[Measures].[PPQ Count])


But probably a more robust approach is to set the calculation up the
same way that you phrased the logic ie. get all the members except for
ID 0.

eg.

SUM(EXCEPT([Patient Stay].[PPQ Answer ID].[PPQ Answer ID].Members,
[Patient Stay].[PPQ Answer ID].&[0]) ,[Measures].[PPQ Count])



--
Regards
Darren Gosbell - SQL Server MVP
Blog: http://www.geekswithblogs.net/darrengosbell

In article <1155120521.449436.289770 (AT) i42g2000cwa (DOT) googlegroups.com>,
florian.stammer (AT) gmail (DOT) com says...
filter({[Measures].[PPQ Count]},[Patient Stay].[PPQ Answer ID] <> 0)
---- this is a calculation in Analysis Service

PPQ Answer ID has a range from 0-4 and I'd like only those values which
are not 0.

PPQ Count is a measure where PPQ Answer ID is summed up


Unfortunately the Calculation doesn't work and shows the following
error msg.: function expects a string or a numeric but instead it gets
a tupel as an argument

anybody knows how to solve this.

backgroung is I#d like to calculate an average with all PPQ Answer IDs
which are not 0.

Thanks




Reply With Quote
  #4  
Old   
florian
 
Posts: n/a

Default Re: calculation in analysis services - 08-09-2006 , 09:05 AM



Is it possible that it doesn't work because [Patient Stay].[PPQ Answer]
is no Measure but part of a dimensional table.

I always get #value!




florian schrieb:

Quote:
hi,

thanks for your help.

I tried:SUM(EXCEPT([Patient Stay].[PPQ Answer ID].[PPQ Answer
ID].Members, [Patient Stay].[PPQ Answer ID].&[0]) ,[Measures].[PPQ
Count])

but I got hierachie [PPQ Answer ID] was not found in the cube when
analysing the string [Patient Stay].[PPQ Answer ID].[PPQ Answer ID]

then I tried SUM(EXCEPT([Patient Stay].[PPQ Answer ID].Members,
[Patient Stay].[PPQ Answer ID].&[0]) ,[Measures].[PPQ Count])

but I got hierachie [PPQ Answer ID] was not found in the cube.

But maybe there is another way of solving my problem to get my
calculation right - I'll only need the correct [PPQ Count] the the one
without any PPQ Answer IDs who are 0. Isn't there an easy way to update
this in the properties window of the [PPQ Count] Measure - now only the
aggregate function is set to count - I would need count without 0.

Thanks



Darren Gosbell schrieb:

There are a couple of problems with your filter statment, rather than go
into them - there is probably a better approach than using FILTER(),
which is to directly sum up the required values from the PPQ Answer ID
attribute.

You could either do this inclusively by adding up id's 1 to 4. (I am
assuming here that the ID is the key value for the attribute)

eg.

SUM({[Patient Stay].[PPQ Answer ID].&[1]:[Patient Stay].[PPQ Answer ID].
&[4]} ,[Measures].[PPQ Count])


But probably a more robust approach is to set the calculation up the
same way that you phrased the logic ie. get all the members except for
ID 0.

eg.

SUM(EXCEPT([Patient Stay].[PPQ Answer ID].[PPQ Answer ID].Members,
[Patient Stay].[PPQ Answer ID].&[0]) ,[Measures].[PPQ Count])



--
Regards
Darren Gosbell - SQL Server MVP
Blog: http://www.geekswithblogs.net/darrengosbell

In article <1155120521.449436.289770 (AT) i42g2000cwa (DOT) googlegroups.com>,
florian.stammer (AT) gmail (DOT) com says...
filter({[Measures].[PPQ Count]},[Patient Stay].[PPQ Answer ID] <> 0)
---- this is a calculation in Analysis Service

PPQ Answer ID has a range from 0-4 and I'd like only those values which
are not 0.

PPQ Count is a measure where PPQ Answer ID is summed up


Unfortunately the Calculation doesn't work and shows the following
error msg.: function expects a string or a numeric but instead it gets
a tupel as an argument

anybody knows how to solve this.

backgroung is I#d like to calculate an average with all PPQ Answer IDs
which are not 0.

Thanks




Reply With Quote
  #5  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: calculation in analysis services - 08-11-2006 , 04:38 AM



I could see that it was a dimension, but I don't know why it is saying
that the hierarchy cannot be found. I was just picking up the names from
the previous sample you provided.

--
Regards
Darren Gosbell - SQL Server MVP
Blog: http://www.geekswithblogs.net/darrengosbell

In article <1155132336.082600.186570 (AT) 75g2000cwc (DOT) googlegroups.com>,
florian.stammer (AT) gmail (DOT) com says...
Quote:
Is it possible that it doesn't work because [Patient Stay].[PPQ Answer]
is no Measure but part of a dimensional table.

I always get #value!




florian schrieb:

hi,

thanks for your help.

I tried:SUM(EXCEPT([Patient Stay].[PPQ Answer ID].[PPQ Answer
ID].Members, [Patient Stay].[PPQ Answer ID].&[0]) ,[Measures].[PPQ
Count])

but I got hierachie [PPQ Answer ID] was not found in the cube when
analysing the string [Patient Stay].[PPQ Answer ID].[PPQ Answer ID]

then I tried SUM(EXCEPT([Patient Stay].[PPQ Answer ID].Members,
[Patient Stay].[PPQ Answer ID].&[0]) ,[Measures].[PPQ Count])

but I got hierachie [PPQ Answer ID] was not found in the cube.

But maybe there is another way of solving my problem to get my
calculation right - I'll only need the correct [PPQ Count] the the one
without any PPQ Answer IDs who are 0. Isn't there an easy way to update
this in the properties window of the [PPQ Count] Measure - now only the
aggregate function is set to count - I would need count without 0.

Thanks



Darren Gosbell schrieb:

There are a couple of problems with your filter statment, rather than go
into them - there is probably a better approach than using FILTER(),
which is to directly sum up the required values from the PPQ Answer ID
attribute.

You could either do this inclusively by adding up id's 1 to 4. (I am
assuming here that the ID is the key value for the attribute)

eg.

SUM({[Patient Stay].[PPQ Answer ID].&[1]:[Patient Stay].[PPQ Answer ID].
&[4]} ,[Measures].[PPQ Count])


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.