dbTalk Databases Forums  

Making a tuple problem (Type mismatch)

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Making a tuple problem (Type mismatch) in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
martinbx
 
Posts: n/a

Default Making a tuple problem (Type mismatch) - 09-06-2005 , 07:36 AM






Hi!
I have a set sTemp3Iff, I need to combine each elment of this set with
[Measures][Npv] and convert whole result into string. My problem is that MDX
declare TYPE MISMATCH error for (sTemp3Iff.Current,[Measures].[Npv]), but
works well with
(sTemp3Iff.Item(0)[Measures].[Npv]). I am at loss at what is going on and
how to fix it. I would be grateful for any help.

Generate
(
sTemp3Iff,
CStr((sTemp3Iff.Current,[Measures].[Npv])),
"+"
)


Reply With Quote
  #2  
Old   
Brian Altmann
 
Posts: n/a

Default RE: Making a tuple problem (Type mismatch) - 09-06-2005 , 09:41 AM






Do you mean something like:

with
set sTemp3Iff as '{[Food],[Drink],[Bread]}'
member measures.Test as 'Generate( sTemp3Iff , "(" +
sTemp3Iff.Current.Item(0).Name + ",[Measures].[Unit Sales])" ,"+")'
select {Test} on columns
from sales

HTH,

--
Brian Altmann
BI Specialist
Huddle Group S.A (www.huddle.com.ar)
www.geocities.com/brianaltmann/olap.html


"martinbx" wrote:

Quote:
Hi!
I have a set sTemp3Iff, I need to combine each elment of this set with
[Measures][Npv] and convert whole result into string. My problem is that MDX
declare TYPE MISMATCH error for (sTemp3Iff.Current,[Measures].[Npv]), but
works well with
(sTemp3Iff.Item(0)[Measures].[Npv]). I am at loss at what is going on and
how to fix it. I would be grateful for any help.

Generate
(
sTemp3Iff,
CStr((sTemp3Iff.Current,[Measures].[Npv])),
"+"
)


Reply With Quote
  #3  
Old   
martinbx
 
Posts: n/a

Default RE: Making a tuple problem (Type mismatch) - 09-06-2005 , 10:36 AM



Yes, It seems that if there is no data [Measures].[Npv] ([Measures].[Unit
Sales] in your example) for one of the sTemp3Iff's items, then MDX stops
processing and returns an error.


"Brian Altmann" wrote:

Quote:
Do you mean something like:

with
set sTemp3Iff as '{[Food],[Drink],[Bread]}'
member measures.Test as 'Generate( sTemp3Iff , "(" +
sTemp3Iff.Current.Item(0).Name + ",[Measures].[Unit Sales])" ,"+")'
select {Test} on columns
from sales

HTH,

--
Brian Altmann
BI Specialist
Huddle Group S.A (www.huddle.com.ar)
www.geocities.com/brianaltmann/olap.html


"martinbx" wrote:

Hi!
I have a set sTemp3Iff, I need to combine each elment of this set with
[Measures][Npv] and convert whole result into string. My problem is that MDX
declare TYPE MISMATCH error for (sTemp3Iff.Current,[Measures].[Npv]), but
works well with
(sTemp3Iff.Item(0),[Measures].[Npv]). I am at loss at what is going on and
how to fix it. I would be grateful for any help.

Generate
(
sTemp3Iff,
CStr((sTemp3Iff.Current,[Measures].[Npv])),
"+"
)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.