Showing posts with label returns. Show all posts
Showing posts with label returns. Show all posts

Monday, February 13, 2012

% remainder in SQL

In t-sql you can do the following to check if a value is odd or even. If it returns a 0 then the number is even, if it returns a 1 it is an odd number.
select @.Value%2

I need to do something similar in a backgroundColor expression in RS 2005, any ideas? I dont see any built-in function for this.

You could do something like this and just use the boolean result(pseudocode only, not tested)

(@.Value/2 = CInt(@.Value/2))

|||

Thanks csi_hugh

This works great!

Thursday, February 9, 2012

#Err results from query.

Hi,
Would you know why the following MDX returns '#Err' as values?
WITH
SET [Set1] AS '[Customers].[Country].Members'
MEMBER [Measures].[T] as '[Set1].Current.Item(0).UniqueName'
SELECT {[measures].[t]} ON COLUMNS,
[Set1] on Rows
FROM [Sales]
Thanks.Current function returns the current tuple from a set *during an iteration*.
Here, you should modify the calcualted member as following,
MEMBER [Measures].[T] AS 'Customers.CurrentMember.UniqueName'
Ohjoo Kwon
"John" <nospam> wrote in message
news:%23%23U0H68LFHA.3420@.tk2msftngp13.phx.gbl...
> Hi,
> Would you know why the following MDX returns '#Err' as values?
> WITH
> SET [Set1] AS '[Customers].[Country].Members'
> MEMBER [Measures].[T] as '[Set1].Current.Item(0).UniqueName'
> SELECT {[measures].[t]} ON COLUMNS,
> [Set1] on Rows
> FROM [Sales]
> Thanks.
>