Chris Webb's BI Blog

Analysis Services, MDX, PowerPivot, DAX and anything BI-related

Raising your own errors in Yukon

with one comment

Another thing I’ve noticed in Books Online – the new ERROR function, which allows you to raise your own errors. For example in AdventureWorks, try the following query:

WITH MEMBER MEASURES.TEST AS
IIF(MEASURES.[INTERNET ORDER COUNT]>2000
, MEASURES.[INTERNET ORDER COUNT]
, ERROR("TOO LOW!")
)
SELECT {MEASURES.[INTERNET ORDER COUNT], MEASURES.TEST} ON 0,
[DATE].[CALENDAR TIME].[ALL PERIODS].CHILDREN ON 1
FROM
[DIRECT SALES]

There’s a section in BOL on error handling which isn’t filled in yet so I guess this is probably only the tip of the iceberg as far as this area of functionality is concerned, but it’s interesting nonetheless.

Written by Chris Webb

February 18, 2005 at 3:25 pm

Posted in Analysis Services

One Response

Subscribe to comments with RSS.

  1. It isn\’t a tip of the iceberg – it is the entire iceberg in this area. I.e. you can put an MDX expression which returns a string inside Error function:Error("Product " + Product.CurrentMember.UniqueName + " has encountered an error in member property Weight")

    Mosha

    February 18, 2005 at 6:17 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 2,859 other followers

%d bloggers like this: