dbTalk Databases Forums  

Using a Calculated Measure to Emulate a Text Measure

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


Discuss Using a Calculated Measure to Emulate a Text Measure in the microsoft.public.sqlserver.olap forum.



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

Default Using a Calculated Measure to Emulate a Text Measure - 06-14-2004 , 04:48 PM






I'm trying to create a measure that will return either an error
message or when aggregated, show the number of errors. I first
created an Error Count measure that does a simple sum of the errors.
Then I created a calculated measure that basically consits of an iif
that returns the count if the count is > 1 or "some text" if the count
is 1. The problem I'm having is how to actually refer to the error
text ("some text" is currently a placeholder) in that statement. The
source column for the Error Count measure is an errorTypeId column
which links to an ErrorType table that contains the description that I
want to show. I was thinking of somehow creating a dimension off of
the ErrorType table and then getting the appropriate member back by
using the ErrorTypeId that is being used for the Error Count measure.
But I haven't been able to get anything to work so far. Does anyone
have any ideas?

David

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

Default RE: Using a Calculated Measure to Emulate a Text Measure - 06-18-2004 , 11:34 AM






I sounds like you may want to reconsider the design of your data structures. If what you are measuring is the occurance of a error, then this is the fact, or transaction information. It sounds liek you record the type of error that occured and have attribute data for that error type (ie description/text).

You may want to consider have a fact table which records the occurance of an error, supplemented by an error dimension which contains the text of the error.

rather than trying to create a text measure - measures ought to be numeric and additive (such as count).

"David Hwang" wrote:

Quote:
I'm trying to create a measure that will return either an error
message or when aggregated, show the number of errors. I first
created an Error Count measure that does a simple sum of the errors.
Then I created a calculated measure that basically consits of an iif
that returns the count if the count is > 1 or "some text" if the count
is 1. The problem I'm having is how to actually refer to the error
text ("some text" is currently a placeholder) in that statement. The
source column for the Error Count measure is an errorTypeId column
which links to an ErrorType table that contains the description that I
want to show. I was thinking of somehow creating a dimension off of
the ErrorType table and then getting the appropriate member back by
using the ErrorTypeId that is being used for the Error Count measure.
But I haven't been able to get anything to work so far. Does anyone
have any ideas?

David


Reply With Quote
  #3  
Old   
David Hwang
 
Posts: n/a

Default Re: Using a Calculated Measure to Emulate a Text Measure - 06-22-2004 , 11:56 AM



I was thinking of using a dimension that contained the text of the
error, but I didn't know how to relay that information back to the
user. If a user is looking at a view on the cube and sees that a
certain value has an error, how can they retrieve the error
information from that dimension?

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

Quote:
I sounds like you may want to reconsider the design of your data structures. If what you are measuring is the occurance of a error, then this is the fact, or transaction information. It sounds liek you record the type of error that occured and have attribute data for that error type (ie description/text).

You may want to consider have a fact table which records the occurance of an error, supplemented by an error dimension which contains the text of the error.

rather than trying to create a text measure - measures ought to be numeric and additive (such as count).

"David Hwang" wrote:

I'm trying to create a measure that will return either an error
message or when aggregated, show the number of errors. I first
created an Error Count measure that does a simple sum of the errors.
Then I created a calculated measure that basically consits of an iif
that returns the count if the count is > 1 or "some text" if the count
is 1. The problem I'm having is how to actually refer to the error
text ("some text" is currently a placeholder) in that statement. The
source column for the Error Count measure is an errorTypeId column
which links to an ErrorType table that contains the description that I
want to show. I was thinking of somehow creating a dimension off of
the ErrorType table and then getting the appropriate member back by
using the ErrorTypeId that is being used for the Error Count measure.
But I haven't been able to get anything to work so far. Does anyone
have any ideas?

David


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.