Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query.Command Text Error

Status
Not open for further replies.

levodestro

Programmer
Joined
Mar 20, 2008
Messages
9
Location
BR
Hi,

I have a Reporting Services Report that access a SQL Server 2000 server. I need to select data from a date range, but when I try the code above, I receive this error message: "FORMULA ERROR - CANNOT CONVERT SET TO TUPLE - IN THE {...} FUNCTION".

The date dimension structure is YEAR.MONTH.WEEK.DAY.

= "
WITH

MEMBER [Data].[Fiscal Year].[All Data].[Atual]
As
'
[Data].[Fiscal Year].[Mês].[" & Parameters!MES.Label & "]
'

SET [Medida] AS
'
{
[Measures].[Previsão],
[Measures].[Total Carteira],
[Measures].[Faturado],

[Measures].[vlICMI],
[Measures].[vlFaturado],

[Measures].[NIV Target],
[Measures].[NIV Carteira],
[Measures].[NIV Faturado],

[Measures].[PPR Pedido %],
[Measures].[PPR Faturado %],

[Measures].[PPR Pedido],
[Measures].[PPR Faturado],

[Measures].[TPR Pedido],
[Measures].[TPR Faturado],

[Measures].[Agreement on Invoice],
[Measures].[Agreement on Invoice NF],

[Measures].[NSV Estimado]
}
'

MEMBER [Produtos].[Linha].[Linha].[Café].[Pilão Verão]
As
'
Aggregate({
[Produtos].[Linha].[Produto].[001250 - CAFE PILAO SABOR DE VERAO ALMOFA 10X500G],
[Produtos].[Linha].[Produto].[001251 - CAFE PILAO SABOR DE VERAO ALMOFA 20X250G],
[Produtos].[Linha].[Produto].[001285 - CAFE PILAO SABOR DE VERAO VACUO 20X500G],
[Produtos].[Linha].[Produto].[001286 - CAFE PILAO SABOR DE VERAO VACUO 20X250G],
[Produtos].[Linha].[Produto].[001290 - CAFE PILAO SABOR DE VERAO ALMOF 90X40 G]
})
'

MEMBER [Produtos].[Linha].[Linha].[Café].[Pilão Intenso]
As
'
Aggregate({
[Produtos].[Linha].[Produto].[001287 - CAFE PILAO INTENSO VACUO CX 20X250G],
[Produtos].[Linha].[Produto].[001288 - CAFE PILAO INTENSO VACUO CX 20X500G],
[Produtos].[Linha].[Produto].[001291 - CAFE PILAO INTENSO ALMOFADA FD 20X250 G],
[Produtos].[Linha].[Produto].[001292 - CAFE PILAO INTENSO ALMOFADA FD 10X500 G]
})
'

SET [LinhaCafe]
As
'
{
[Produtos].[Linha].[Linha].[Café].[Pilão],
[Produtos].[Linha].[Linha].[Café].[Pilão Verão],
[Produtos].[Linha].[Linha].[Café].[Pilão Intenso],
[Produtos].[Linha].[Linha].[Café].[Do Ponto],
[Produtos].[Linha].[Linha].[Café].[Caboclo],
[Produtos].[Linha].[Linha].[Café].[União],
[Produtos].[Linha].[Linha].[Café].[Seleto]
}
'

MEMBER [Produtos].[Linha].[Linha].[Café Solúvel].[Tradicional Ponto]
As
'
[Produtos].[Linha].[Linha].[Café Solúvel].[Do Ponto].[Café Solúvel Tradicional]
'

MEMBER [Produtos].[Linha].[Linha].[Café Solúvel].[Tradicional Pilão]
As
'
[Produtos].[Linha].[Linha].[Café Solúvel].[Pilão].[Solúvel Pilão Trad.]
'

SET [LinhaSoluvel]
As
'
{
[Produtos].[Linha].[Linha].[Café Solúvel].[Tradicional Ponto],
[Produtos].[Linha].[Linha].[Café Solúvel].[Tradicional Pilão]
}
'

SET [LinhaFiltroSaraLee]
As
'
{
[Produtos].[Linha].[Linha].[Filtros].[Pilão],
[Produtos].[Linha].[Linha].[Filtros].[Do Ponto]
}
'

SET [LinhaFiltro]
As
'
{[LinhaFiltroSaraLee]}
'

MEMBER [Produtos].[Linha].[Linha].[Café].[Total]
As
'
[Produtos].[Linha].[Linha].[Café]
'

MEMBER [Produtos].[Linha].[Linha].[Cappuccinos].[Total]
As
'
[Produtos].[Linha].[Linha].[Cappuccinos]
'

MEMBER [Produtos].[Linha].[Linha].[Filtros].[Total]
As
'
[Produtos].[Linha].[Linha].[Filtros]
'

MEMBER [Produtos].[Linha].[Linha].[Café Solúvel].[Total]
As
'
[Produtos].[Linha].[Linha].[Café Solúvel]
'

SET [LinhaMarca]
As
'
{
[Produtos].[Linha].[Linha].[Café].[Total], [LinhaCafe],
[Produtos].[Linha].[Linha].[Café Solúvel].[Total], [LinhaSoluvel],
[Produtos].[Linha].[Linha].[Filtros].[Total], [LinhaFiltro],
[Produtos].[Linha].[Linha].[Cappuccinos].[Total]
}
'

MEMBER [Vendedor].[All Vendedor].[KAs]
As
'
[Vendedor].[Agencia].[Key Accounts]
'

MEMBER [Vendedor].[All Vendedor].[MG]
As
'
[Vendedor].[Agencia].[Minas Gerais]
'

MEMBER [Vendedor].[All Vendedor].[EXPO]
As
'
[Vendedor].[Agencia].[Exportação]
'

MEMBER [Vendedor].[All Vendedor].[MOKA.]
As
'
[Vendedor].[All Vendedor].[OMOK]
'

MEMBER [Vendedor].[All Vendedor].[SP Int]
As
'
[Vendedor].[Agencia].[SP Interior]
'

MEMBER [Vendedor].[All Vendedor].[SP Metro]
As
'
[Vendedor].[Agencia].[SP Metro]
'

MEMBER [Vendedor].[All Vendedor].[CO]
As
'
[Vendedor].[Agencia].[Centro-Oeste]
'

MEMBER [Vendedor].[All Vendedor].[NNE]
As
'
[Vendedor].[Agencia].[North/NE]
'

MEMBER [Vendedor].[All Vendedor].[Food]
As
'
[Vendedor].[Agencia].[Food Service]
'


MEMBER [Vendedor].[All Vendedor].[RJ-ES]
As
'
[Vendedor].[Agencia].[Rio de Janeiro-ES]
'

MEMBER [Vendedor].[All Vendedor].[South]
As
'
[Vendedor].[Agencia].[South]
'

SET [Agencias]
As
'
{
[Vendedor].[All Vendedor].[KAs],
[Vendedor].[All Vendedor].[EXPO],
[Vendedor].[All Vendedor].[SP Int],
[Vendedor].[All Vendedor].[SP Metro],
[Vendedor].[All Vendedor].[CO],
[Vendedor].[All Vendedor].[NNE],
[Vendedor].[All Vendedor].[South],
[Vendedor].[All Vendedor].[Food],
[Vendedor].[All Vendedor].[RJ-ES],
[Vendedor].[All Vendedor].[MG]
}
'

MEMBER [Vendedor].[All Vendedor].[Total]
As
'
Aggregate([Agencias])
'

SET [Agencia]
As
'{[Agencias], [Vendedor].[All Vendedor].[Total],[Vendedor].[All Vendedor].[MOKA.]}'

SET [ClientePortePorte] AS
'
{
[Cliente].[Porte].[Atacado Cash & Carry],
[Cliente].[Porte].[Atacado Distribuidor],
[Cliente].[Porte].[ Atacado Food Service],
[Cliente].[Porte].[Cesta Basica],
[Cliente].[Porte].[Distrib.Food Service],
[Cliente].[Porte].[Distribuidor Parceiro],
[Cliente].[Porte].[Exportação],
[Cliente].[Porte].[Franquias],
[Cliente].[Porte].[Grande Varejo],
[Cliente].[Porte].[Key Account],
[Cliente].[Porte].[ Venda Direta]
}
'

MEMBER [Cliente].[Porte].[Total] AS
'Aggregate([ClientePortePorte])'

SET [ClientePorte] AS
'{[ClientePortePorte],[Cliente].[Porte].[Total]}'

MEMBER [Data].[Fiscal Year].[All Data].[Periodo] AS
'
{Aggregate([Data].[Fiscal Year].[Agosto 10].[32].[2])}:{Aggregate([Data].[Fiscal Year].[Agosto 10].[33].[10])}
'

SELECT
CrossJoin({CrossJoin([Agencia],[LinhaMarca])},{[ClientePorte]}) ON ROWS,
({[Medida]}) ON COLUMNS
FROM [cSalesKPI]
WHERE {[Data].[Fiscal Year].[All Data].[Periodo]}"

Any help is welcome.

Thanks.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top