Groups | Blog | Home
all groups > sql server data mining > november 2005 >

sql server data mining : name calculation problem


sqlster
11/26/2005 6:58:02 PM
I am trying to follow the example in sql server data mining book by Jamie and
Tang.

On page 95, step 3 for creating name calculation on customers table, I enter
the following expression:

CASE
WHEN [NUM BEDROOMS] = 1 THEN 'ONE'
WHEN [NUM BEDROOMS] <= 1 THEN 'TWO OR THREE'
WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE'
ELSE 'NONE'
END

When I click okay, I get the following error:

IErrorInfo.GetDescription failed with E_FAIL(0x80004005).

Has this worked for anyone else here or I am missing some thing??

Dejan Sarka
11/27/2005 10:09:39 AM
I haven't tried the example, but I can see a logical error in the code.
Check the 2nd condition - you can't get two or three bedrooms for any case.

--
Dejan Sarka, SQL Server MVP
Mentor
www.SolidQualityLearning.com

[quoted text, click to view]

Jamie MacLennan (MS)
11/28/2005 9:57:08 AM
The third line of the sample is
WHEN [NUM BEDROOMS] <= 3 THEN 'TWO OR THREE'

--

-Jamie MacLennan
SQL Server Data Mining
This posting is provided "AS IS" with no warranties, and confers no rights.
[quoted text, click to view]

sqlster
11/28/2005 6:51:03 PM
I am still getting the same error
====
IErrorInfo.GetDescription failed with E_FAIL(0x80004005).
===


when I enter the following expression.
CASE
WHEN [NUM BEDROOMS] = 1 THEN 'ONE'
WHEN [NUM BEDROOMS] <= 3 THEN 'TWO OR THREE'
WHEN [NUM BEDROOMS] >= 4 THEN 'FOUR OR MORE'
ELSE 'NONE'
END

Please help.

TIA..


[quoted text, click to view]
ZULFIQAR SYED
11/28/2005 7:09:02 PM
You could try this feature by creating a temp table as follows

create table temptbl
(id int not null primary key,
c1 varchar(33)
)
go
insert temptbl(id,c1) values(1,'val1')
insert temptbl(id,c1) values(2,'val2')
insert temptbl(id,c1) values(3,'val3')
insert temptbl(id,c1) values(4,'val4')

go
select * from temptbl
go

In data source view, after adding the table, you could add a named column as
follows:

case
when id <=2 then 'great'
when id >2 then 'greatest'
else 'super'
end

Try exploring the data and it should work.

I am not sure on why you are getting this particular error on MovieClick
database.

HTH...
--
http://zulfiqar.typepad.com
BSEE, MCP


[quoted text, click to view]
Jamie MacLennan (MS)
11/29/2005 9:31:06 AM
Here's some questions to try to narrow the issue - it seems unusual.

You aren't having any problems browsing the data without the named
calculation?

Have any named calculations worked? (If you haven't tried, try a named calc
with expression '1' and some name)

Are you connecting to a SQL database or MS Access database?

Thanks
--

-Jamie MacLennan
SQL Server Data Mining
This posting is provided "AS IS" with no warranties, and confers no rights.
[quoted text, click to view]

sqlster
11/29/2005 7:17:05 PM
Hi Jamie,

Thanks for addressing this. Here are my answers to clarify the issue.

[quoted text, click to view]

<sqlster>
I can browse the date without named calculation..
</sqlster>

[quoted text, click to view]

<sqlster>
Yes, the one you mentioned does work.
</sqlster>

[quoted text, click to view]

<sqlster>
I am connecting to MS access database even though I don't have access
installed on vpc2k4 session being used for BIDS or SSMS.
</sqlster>

[quoted text, click to view]
Jamie MacLennan (MS)
11/30/2005 9:34:17 AM
MS Access (i.e. Jet) doesn't support CASE. You have to use IIF, e.g.

SELECT *, IIF(AGE>30, 'Yes' , 'No') AS Over30
FROM Customers

--

-Jamie MacLennan
SQL Server Data Mining
This posting is provided "AS IS" with no warranties, and confers no rights.
[quoted text, click to view]

sqlster
11/30/2005 11:23:11 AM
Thanks Jamie..

[quoted text, click to view]
AddThis Social Bookmark Button