Home > Archive > MS SQL Server OLAP > March 2006 > "SET" in "where"clause









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author "SET" in "where"clause
Ihor Kovalenko

2006-03-31, 9:31 am


Hi,

first time the problem seems to be not so complicated, but ...

For example, we have a "chart of accounts" and "time" as dimensions,
"debit" and "credit" as measures. Time has Year and Month levels.

AS 2005:
with member [measures].[Current balance] as -- row balance
'measures.[Debit] + [measures].[Credit]'
member '[measures].[Total balance] as -- balance row in chart of
accounts to show
'sum([Time].[Time].Currentmemeber.level.members(0):
[Time].[Time].CurrentMember, [measures].[Current balance]'
select [account].Members on rows, -- chart of accounts
{ measures.[Debit], measures.[Credit], measures.[Current balance],
measures.[Total balance] } on columns
FROM [Accounting]
where ([Department].[Dept 1], [Time].[Time].[12.2005] )


This query works fine until it has been a little modified in where
clause:

where ([Department].[Dept 1],
{ [Time].[Time].[09.2005]:[Time].[Time].[12.2005] } )

The same query generated by Excel if you'll choose Time as selection
criteria and more then one month will be choosen.

This query also can be executed but [Time].[Time].Currentmember is not
longer valid because this is a set rather than a member, and [Total
balance] measure shows #Err. Any help will be appreciated.

Thank you.


*** Sent via Developersdex http://www.droptable.com ***
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com