![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Thread-Topic: MDX Named Set and OPENQUERY thread-index: AcYwwRZD0vaiqTNpTaq6CUlGyNshng== X-WBNR-Posting-Host: 84.147.162.230 From: =?Utf-8?B?UGF0?= <pat (AT) online (DOT) nospam Subject: MDX Named Set and OPENQUERY Date: Mon, 13 Feb 2006 09:15:28 -0800 Lines: 33 Message-ID: <D47F580D-8709-4FBC-8968-C398F40D1514 (AT) microsoft (DOT) com MIME-Version: 1.0 Content-Type: text/plain; charset="Utf-8" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft CDO for Windows 2000 Content-Class: urn:content-classes:message Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0 Newsgroups: microsoft.public.sqlserver.olap NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250 Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.olap:67175 X-Tomcat-NG: microsoft.public.sqlserver.olap When I run the following MDX Query in SSMS towards an SSAS 2005 cube, I get correct results: with set SelectedStores as {Stores.Stores.members} select {[Measures].[Units]} on columns, nonemptycrossjoin ({Stores.[Store Types].members}, SelectedStores) on rows from [smCube] However if I run the same query from SQL Server (relational) using OPENQUERY, I get an error "OLE DB provider "MSOLAP" for linked server "olap" returned message "Query (5, 56) The dimension '[SelectedStores]' was not found in the cube when the string, [SelectedStores], was parsed."." select * from openquery(olap,' with set SelectedStores as {Stores.Stores.members} select {[Measures].[Units]} on columns, nonemptycrossjoin ({Stores.[Store Types].members}, SelectedStores) on rows from [smCube] ') What am I doing wrong? When I run the same query without the named set, I also get correct results: select * from openquery(olap,' select {[Measures].[Units]} on columns, nonemptycrossjoin ({Stores.[Store Types].members}, {Stores.Stores.members}) on rows from [smPuma6] ') |
#3
| |||
| |||
|
|
Hello Pat, You may want to add ' before { to test: with set SelectedStores as '{Stores.Stores.members}' Best Regards, Peter Yang MCSE2000/2003, MCSA, MCDBA Microsoft Online Partner Support When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== === This posting is provided "AS IS" with no warranties, and confers no rights. -------------------- Thread-Topic: MDX Named Set and OPENQUERY thread-index: AcYwwRZD0vaiqTNpTaq6CUlGyNshng== X-WBNR-Posting-Host: 84.147.162.230 From: =?Utf-8?B?UGF0?= <pat (AT) online (DOT) nospam Subject: MDX Named Set and OPENQUERY Date: Mon, 13 Feb 2006 09:15:28 -0800 Lines: 33 Message-ID: <D47F580D-8709-4FBC-8968-C398F40D1514 (AT) microsoft (DOT) com MIME-Version: 1.0 Content-Type: text/plain; charset="Utf-8" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft CDO for Windows 2000 Content-Class: urn:content-classes:message Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0 Newsgroups: microsoft.public.sqlserver.olap NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250 Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.olap:67175 X-Tomcat-NG: microsoft.public.sqlserver.olap When I run the following MDX Query in SSMS towards an SSAS 2005 cube, I get correct results: with set SelectedStores as {Stores.Stores.members} select {[Measures].[Units]} on columns, nonemptycrossjoin ({Stores.[Store Types].members}, SelectedStores) on rows from [smCube] However if I run the same query from SQL Server (relational) using OPENQUERY, I get an error "OLE DB provider "MSOLAP" for linked server "olap" returned message "Query (5, 56) The dimension '[SelectedStores]' was not found in the cube when the string, [SelectedStores], was parsed."." select * from openquery(olap,' with set SelectedStores as {Stores.Stores.members} select {[Measures].[Units]} on columns, nonemptycrossjoin ({Stores.[Store Types].members}, SelectedStores) on rows from [smCube] ') What am I doing wrong? When I run the same query without the named set, I also get correct results: select * from openquery(olap,' select {[Measures].[Units]} on columns, nonemptycrossjoin ({Stores.[Store Types].members}, {Stores.Stores.members}) on rows from [smPuma6] ') |
#4
| |||
| |||
|
|
Hello Pat, You may want to add ' before { to test: with set SelectedStores as '{Stores.Stores.members}' Best Regards, Peter Yang MCSE2000/2003, MCSA, MCDBA Microsoft Online Partner Support When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== === This posting is provided "AS IS" with no warranties, and confers no rights. -------------------- Thread-Topic: MDX Named Set and OPENQUERY thread-index: AcYwwRZD0vaiqTNpTaq6CUlGyNshng== X-WBNR-Posting-Host: 84.147.162.230 From: =?Utf-8?B?UGF0?= <pat (AT) online (DOT) nospam Subject: MDX Named Set and OPENQUERY Date: Mon, 13 Feb 2006 09:15:28 -0800 Lines: 33 Message-ID: <D47F580D-8709-4FBC-8968-C398F40D1514 (AT) microsoft (DOT) com MIME-Version: 1.0 Content-Type: text/plain; charset="Utf-8" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft CDO for Windows 2000 Content-Class: urn:content-classes:message Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0 Newsgroups: microsoft.public.sqlserver.olap NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250 Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.olap:67175 X-Tomcat-NG: microsoft.public.sqlserver.olap When I run the following MDX Query in SSMS towards an SSAS 2005 cube, I get correct results: with set SelectedStores as {Stores.Stores.members} select {[Measures].[Units]} on columns, nonemptycrossjoin ({Stores.[Store Types].members}, SelectedStores) on rows from [smCube] However if I run the same query from SQL Server (relational) using OPENQUERY, I get an error "OLE DB provider "MSOLAP" for linked server "olap" returned message "Query (5, 56) The dimension '[SelectedStores]' was not found in the cube when the string, [SelectedStores], was parsed."." select * from openquery(olap,' with set SelectedStores as {Stores.Stores.members} select {[Measures].[Units]} on columns, nonemptycrossjoin ({Stores.[Store Types].members}, SelectedStores) on rows from [smCube] ') What am I doing wrong? When I run the same query without the named set, I also get correct results: select * from openquery(olap,' select {[Measures].[Units]} on columns, nonemptycrossjoin ({Stores.[Store Types].members}, {Stores.Stores.members}) on rows from [smPuma6] ') |
#5
| |||
| |||
|
|
I did a further test (this time with the quotes) with OPENQUERY. I get the following error message: OLE DB provider "MSOLAP" for linked server "olap" returned message "Query (5, 56) The dimension '[SelectedStores]' was not found in the cube when the string, [SelectedStores], was parsed.". Msg 7321, Level 16, State 2, Line 1 An error occurred while preparing the query " with set SelectedStores as '{Stores.Stores.members}' select {[Measures].[Units]} on columns, nonemptycrossjoin ({Stores.[Store Types].members}, SelectedStores) on rows from [smCube] " for execution against OLE DB provider "MSOLAP" for linked server "olap". I proceeded to copy the query from the above error message into an MDX window of SSMS, and the query ran fine. Could it have to do with the settings of the linked server (the first parameter of the OPENQUERY function) ? "Peter Yang [MSFT]" wrote: Hello Pat, You may want to add ' before { to test: with set SelectedStores as '{Stores.Stores.members}' Best Regards, Peter Yang MCSE2000/2003, MCSA, MCDBA Microsoft Online Partner Support When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== === This posting is provided "AS IS" with no warranties, and confers no rights. -------------------- Thread-Topic: MDX Named Set and OPENQUERY thread-index: AcYwwRZD0vaiqTNpTaq6CUlGyNshng== X-WBNR-Posting-Host: 84.147.162.230 From: =?Utf-8?B?UGF0?= <pat (AT) online (DOT) nospam |
#6
| |||
| |||
|
|
Are you using AS 2005? This sounds like a bug that was first mentioned in this group here. http://groups.google.com/group/micro...olap/browse_th read/thread/6f231baedbd9dbbd/e4470df58d3af6ec I also posted the details of this issue on my blog. http://geekswithblogs.net/darrengosb.../14/65848.aspx This is apparently fixed in the SP1 builds, but I have not heard anything else about this issue. I don't even know if MS has a hot fix available. Is restructuring the query to move the set definition inline in the query an option for you? -- Regards Darren Gosbell [MCSD] Blog: http://www.geekswithblogs.net/darrengosbell In article <557937A8-4173-430A-A64A-2C40C1A06986 (AT) microsoft (DOT) com>, pat (AT) online (DOT) nospam says... I did a further test (this time with the quotes) with OPENQUERY. I get the following error message: OLE DB provider "MSOLAP" for linked server "olap" returned message "Query (5, 56) The dimension '[SelectedStores]' was not found in the cube when the string, [SelectedStores], was parsed.". Msg 7321, Level 16, State 2, Line 1 An error occurred while preparing the query " with set SelectedStores as '{Stores.Stores.members}' select {[Measures].[Units]} on columns, nonemptycrossjoin ({Stores.[Store Types].members}, SelectedStores) on rows from [smCube] " for execution against OLE DB provider "MSOLAP" for linked server "olap". I proceeded to copy the query from the above error message into an MDX window of SSMS, and the query ran fine. Could it have to do with the settings of the linked server (the first parameter of the OPENQUERY function) ? "Peter Yang [MSFT]" wrote: Hello Pat, You may want to add ' before { to test: with set SelectedStores as '{Stores.Stores.members}' Best Regards, Peter Yang MCSE2000/2003, MCSA, MCDBA Microsoft Online Partner Support When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== === This posting is provided "AS IS" with no warranties, and confers no rights. -------------------- Thread-Topic: MDX Named Set and OPENQUERY thread-index: AcYwwRZD0vaiqTNpTaq6CUlGyNshng== X-WBNR-Posting-Host: 84.147.162.230 From: =?Utf-8?B?UGF0?= <pat (AT) online (DOT) nospam |
#7
| |||
| |||
|
|
Thanks Darren, definitely looks like it. I had done a search in this newsgroup but couldn't find similar issues. I also agree with the suggestions at the end of your blog. I use the OPENQUERY because some of the info is in the relational DB only, not available in SSAS. I'd like to investigate your suggestions further though (.Net Functions and ⤽Stored Procedures⤝ within Analysis Services), do you have links about the subject that you would recommend? "Darren Gosbell" wrote: Are you using AS 2005? This sounds like a bug that was first mentioned in this group here. http://groups.google.com/group/micro...olap/browse_th read/thread/6f231baedbd9dbbd/e4470df58d3af6ec I also posted the details of this issue on my blog. http://geekswithblogs.net/darrengosb.../14/65848.aspx This is apparently fixed in the SP1 builds, but I have not heard anything else about this issue. I don't even know if MS has a hot fix available. Is restructuring the query to move the set definition inline in the query an option for you? -- Regards Darren Gosbell [MCSD] Blog: http://www.geekswithblogs.net/darrengosbell In article <557937A8-4173-430A-A64A-2C40C1A06986 (AT) microsoft (DOT) com>, pat (AT) online (DOT) nospam says... I did a further test (this time with the quotes) with OPENQUERY. I get the following error message: OLE DB provider "MSOLAP" for linked server "olap" returned message "Query (5, 56) The dimension '[SelectedStores]' was not found in the cube when the string, [SelectedStores], was parsed.". Msg 7321, Level 16, State 2, Line 1 An error occurred while preparing the query " with set SelectedStores as '{Stores.Stores.members}' select {[Measures].[Units]} on columns, nonemptycrossjoin ({Stores.[Store Types].members}, SelectedStores) on rows from [smCube] " for execution against OLE DB provider "MSOLAP" for linked server "olap". I proceeded to copy the query from the above error message into an MDX |
![]() |
| Thread Tools | |
| Display Modes | |
| |