Problem With Case And Nested Tables/keys In BI Development Studio
Dec 11, 2006
Hello , i have 2 seperate tables of information about people.
Table A :with a key column Anumber contains mobile telephone numbers and
table B : with a key column named Bnumber contains mobile telephone numbers
These two key columns have the same data type and hold the same information (mobile phone numbers).
Some mobile numbers from table A exist in table B so i wanted to run a clustering algorithm in order to gain information from the two tables.
I created a new table C with all the distinct MobileNumbers found in the tables A and B ,set the Cnumber column as key columns and linked it with the equivalent columns Anumber , Bnumbers from tables A and B.
Although, when i desing a training model in the Business intelligent Studio ( New mining structure) and set table C as case table and A and B as nested tables in the "DataMiningWizard>Specify the columns used in your analysis" window the key columns from table B and C DO NOT appear at all
So if i click next i get a warning (You have not defined a key column for the nested tables).
I proceed, put the key columns manually from the mining structure tab (drag and drop the key columns from the data sourve view) but when i run the clustering algorithm the results doesnt at all make sence as you can see at
I have a problem in design the tables. My main task is to learn how to give the Match Score.
I have hundreds of dataset and one of them is like this:
Test Record Number: 19 Prospect ID = 254040088233400441105260031881009 Match Score = 95 Input Record Fielding ( eg wordnumber[Field] ) : 1[1] 2[1] 3[11] 4[11] 5[11] Prospect Word = 1 type = 1 match level = 4 input word = 1 input type = 1 Prospect Word = 2 type = 2 match level = 0 input word = NA input type = NA Prospect Word = 3 type = 3 match level = 4 input word = 2 input type = 1 Prospect Word = 4 type = 11 match level = 4 input word = 3 input type = 11 Prospect Word = 5 type = 13 match level = 4 input word = 4 input type = 11 Prospect Word = 6 type = 14 match level = 4 input word = 5 input type = 11
Now I have all my data stored in the DB and I seperated them into 3 tables and their structures are:
and the prspid in table 2 & 3 refers to the prospectID in table 1.What I did was setting:
a) prospect table as case table with id AS key, prospectID AS input & predictable;
b) and the other two as nested tables with inputword/inputfield AS key & input, prospectword/prospecttype/matchlevel/inputword/inputtype AS key & input .
But it shows error for having multiply key columns...
And also I am thinking about using the Naive bayes algorithm. Can I also have some suggestion on this?
i am trying to associate city in patient table --> disease in diseases table. I want to build association data mining model and use it on web form, such a way when the user enters city associated disease will be displayed.
should i select all 3 table to build the model? could help me to decide what tables should i select as Case and what tables as Nested? what attributes from the table should i select as key, input, predictive ?
i am using data mining tutorials on sqlserverdatamining.com to build this model. is there anything further during my model building i get into confusion? please suggest me where i can find complete resource or inform here.
i appreciate Mr.Jamie for his guidance so far in my academic project. i do have the book 'Data mining with sql server 2005'. I left with just one day to do this and document.
hoping someone could suggest. your help is much appreciated.
I recently installed the Evaluation Edition of SQL Server 2005 x64 and it appears that MS Visual Studio 2005 is installed in stead of SQL Server Business Intelligence Development Studio. When I choose new project the only template available is "Blank Solution". How do I get all the templates (i.e. Analysis Server Project, Integration Services Project, Report Model Project, Report Server Wizard project, etc.)?
Or would it be better to uninstall MS Visual Studio 2005 and attempt to reinstall BIDS?
ALTER TABLE [Students] WITH CHECK ADD CONSTRAINT [FK_Students_Schools] FOREIGN KEY([SchoolId]) REFERENCES [Schools] ([SchoolId])
What kind of index would ensure best performance for INSERTs/UPDATEs, so that SQL Server can most efficiently check the FK constraints? Would it be simply:
CREATE INDEX IX_Students_SchlId ON Students (SchoolId) Or CREATE INDEX IX_Students_SchlId ON Students (SchoolId, StudentId)
In other words, what's best practice for adding an index which best supports a Foreign Key constraint?
I am running SQL Server 2005 SP2 in Vista. I have Developer editions of everything. I am trying to get BI Development Studio and Analysis Services loaded.
I don't seem to have BI Development Studio loaded. When I go to Control Panel/SQL Server install it says it is already loaded, it needs to be modified. When I try to modify it, it isn't there.
Do I need to run this from the command line with SKUUPGRADE=1 ? Modify the registry?
Second question. Can I get Analysis Services projects loaded into my regular 2005 Visual Studio? How do I install Analysis Services into Visual Studio? Or is it always completely separate, just looks like Visual Studio but can't be accessed from there?
SELECT case when tab1.col2=tab1.col3 and tab1.col3!=0 then (SELECT tab3.col3 FROM tab3) else (case when tab5.col2=tab5.col6 then (SELECT tab7.col1 FROM tab7) else (case when tab1.col2=tab1.col3 then tab1.col4+7 end) end as value From tab5, tab1 WHERE tab1.col1=tab5.col1
I get the error as- Server: Msg 156, Level 15, State 1, Line 6 Incorrect syntax near the keyword 'as'. please help me.
I've got a SP that selects the best price from a table that has all info collected into it. Selecting the price is easy, I use COALESCE.
But I want to have a column next to it that contains which price that was choosen. I used CASE and nested it... worked fine until I reached the 10th level, there is a limit there.
"Case expressions may only be nested to level 10."
I'm sure som people will puke when they see this code and I'm open to suggestions on how to do it in another way. I can always do it in two queries, but it should be possible to do it in one.
I was looking at IF, THEN, ELSE, but I don't find any way to use it in a query, just to determine WHICH query will be run.
Here is my SP (how can I get it in a nice grey area like som people post?):
CREATE PROCEDURE dbo.ProcCOST_SET_TC AS
/* Empty TC table */ truncate table dbo.COST_TC
/* Collect info */ INSERT INTO dbo.COST_TC SELECT REGION,PROJECT,CPN, COALESCE ( Contract_usd, SITEINPUT_sitecontract_usd, SITEINPUT_lastPO_usd, SITEINPUT_lastreceipt_usd, SITEINPUT_other_usd, SITEINPUT_wac_usd, SYSTEM_Min_ContractPrice_usd, SYSTEM_Min_OpenOrder_usd, SYSTEM_Last_Receipt_usd, SYSTEM_Min_WAC_usd, [BP Q-1] ), Case Contract_usd WHEN IsNull(Contract_USD,0) THEN 'Contract' ELSE Case SITEINPUT_sitecontract_usd WHEN IsNull(SITEINPUT_sitecontract_usd,0) THEN 'SITEINPUT Site Contract' ELSE Case SITEINPUT_lastPO_usd WHEN IsNull(SITEINPUT_lastPO_usd,0) THEN 'SITEINPUT Last PO' ELSE Case SITEINPUT_lastreceipt_usd WHEN IsNull(SITEINPUT_lastreceipt_usd,0) THEN 'SITEINPUT Last Receipt' ELSE Case SITEINPUT_other_usd WHEN IsNull(SITEINPUT_other_usd,0) THEN 'SITEINPUT Other' ELSE Case SITEINPUT_wac_usd WHEN IsNull(SITEINPUT_wac_usd,0) THEN 'SITEINPUT WAC' ELSE Case SYSTEM_Min_ContractPrice_usd WHEN IsNull(SYSTEM_Min_ContractPrice_usd,0) THEN 'Min Contract Price' ELSE Case SYSTEM_Min_OpenOrder_usd WHEN IsNull(SYSTEM_Min_OpenOrder_usd,0) THEN 'Min Open Order' ELSE Case SYSTEM_Last_Receipt_usd WHEN IsNull(SYSTEM_Last_Receipt_usd,0) THEN 'Last Receipt' ELSE Case SYSTEM_Min_WAC_usd WHEN IsNull(SYSTEM_Min_WAC_usd,0) THEN 'Min WAC' ELSE Case [BP Q-1] WHEN IsNull([BP Q-1],0) THEN 'BP Q-1' ELSE 'NO DATA' END END END END END END END END END END END FROM COST_AllInfo GO
I'm not sure if this is possible but i'm trying to nest a case statement but keep on getting any error: Incorrect syntax near the keyword 'Then'
Query: SELECT F_DIVISION_NO, Bound, Primary_SIR, Case When Bound Then Sum(CASE WHEN dbo.THIT_RATIO_DETL.DED_AGR_AM=0 THEN dbo.THIT_RATIO_DETL.DED_OCR_AM else dbo.THIT_RATIO_DETL.DED_AGR_AM end)end as Test
From ( Select DBO.THIT_RATIO_DETL.F_DIVISION_NO, Sum(CASE WHEN dbo.THIT_RATIO_DETL.STATUS_CD = "B" or dbo.THIT_RATIO_DETL.STATUS_CD = "K" Then 1 ELSE 0 END) as Bound,
Sum(CASE WHEN dbo.THIT_RATIO_DETL.DED_AGR_AM=0 THEN dbo.THIT_RATIO_DETL.DED_OCR_AM else dbo.THIT_RATIO_DETL.DED_AGR_AM end) as Primary_SIR
FROM dbo.THIT_RATIO_DETL Group by F_DIVISION_NO ) t
Hi, I'm not new to SQL however I get confused when I transfer from different DBMS like Oracle, SQL Server, Firebird, MySQL and Access.
in SQL Server T-SQL, How do I go about a nested select case like the ff: And I supposed to use this as source for a Cross-Tab.
CREATE PROCEDURE SP_SAMPLE( @DateStart datetime, @DateEnd datetime, @Param1 char(3), @Param2 char(1), @Param3 decimal(7,4)) AS BEGIN
SELECT Field1, Field2, Field3, CASE WHEN FieldSomething = 0.0000 THEN '*' WHEN FieldSomething < @Param3 THEN '_' ELSE CASE @Param2 WHEN 'A' THEN SomeOtherField1 WHEN 'B' THEN SomeOtherField2 WHEN 'C' THEN SomeOtherField3 END END Alias1 FROM SampleTable WHERE UPPER(Field2) = UPPER(@Param1) AND Field1 BETWEEN @DateStart AND @DateEnd ORDER BY Field2, Field3, Field1
I have recently started working in a SQL 2005 (Enterprise Edition) clustered environment. I neeed to start using the Business Intelligence Development Studio but it is not installed.
I have tried re-running the setup but there is no component option for BIDS. At which point during installation does it get installed or what do I need to run to install it?
And if I do run setup again will it affect other installed components?
Seeking for Gurus help to install Business Intelligence Development Studio at MS Sql Server Advance.
Scenario:
I checked, I have only .net 2.0 installed along with sql server express including Reporting service.
On top of that when I tried to installed the extracted file setup.exe from SQLEXPR_TOOLKIT.exe it give me messsage Upgrade is blocked.
Name: Microsoft SQL Server 2005 ToolsReason: Your upgrade is blocked. For more information about upgrade support, see the "Version and Edition Upgrades" and "Hardware and Software Requirements" topics in SQL Server 2005 Setup Help or SQL Server 2005 Books Online.
Build version check:
Your upgrade is blocked because the existing component is a later version than the version you are trying to upgrade to. To modify an existing SQL Server component, go to Add or Remove Programs in Control Panel, select the component you would like to modify, and then click Change/Remove.
but I have checked, I dont have BI Development Studio is intalled, I checked at VS.net.. I cant find the component.
i have just installed the SQL Server 2005 eval version to try the Business Intelligence. However, when i click on the Business Intelligence Studio link it starts looking for a file devenv.exe and reports that the file is not found. I have searched for the file and it does not exisits. I have made sure that I selected ALL the components at the time of installation. So although the link to Business Intelligence appears, it is not there. My question is that do i need to install Visual Studio to make this work? I already had Visual Studio 6 - VSS only on the machine.
In what install kit or kits (I have a full MSDN license) do I find the BI Development Studio? I need SSIS.
I downloaded and tried the Developer version but something must have gone wrong during the install because not only did I not get the BI Development Studio, I don't even see the Mgmt Studio.
I've installed SQL Express with advanced services and the BIDS software from the SQL Toolkit using the vs_setup.msi extracted from the toolkit installer (Why not include it in the advanced services?).
Now I'm trying to start BIDS and am asked to log into the Report Server. I use my username and password for ASPNET. The login fails saying that the web application is not available on the web server and to look in the application event log for more information.
There are a bunch of errors listed (and more every 30 seconds are so). The error message is:
aspnet_wp.exe could not be launched because the username and/or password supplied in the processModel section of the config file are invalid.
Also, when I start Visual Web Developer Express I get a message that says there is a Package Load Failure for the Report Designer.
I'm using SQL Server BI Development Studio to create a mining structure to forecast time series analysis. The process to create a model for time series has these steps: Create a connection to the Database; Create a source view. Create relationships between tables using the foreign keys; Create the model with the mining structure. Define the fields that I won€™t to predict and the algorithm properties aren€™t changed. Is something wrong in these steps, I missing something? Other problem is the utilization of the model created earlier. In some tests that I made, the models don€™t do forecasting upper then 20 steps. The problem could be the number of lines? But other data set with a large number of null values doesn€™t have any problem predicting more than 20 steps using the time series algorithm.
I installed SQL Server Express Advanced Edition and Toolkit. According to the documentation, I should be able to create reports using Business Intelligence Development Studio, but I can't find it. There is only a Microsoft Visual Studio 2005 menu instead. I'm just wondering if there is something wrong with my installation, or is BIDS inside Microsoft Visual Studio 2005?
I'am trying to program a nested CASE statements (if this is not possible, does anyone have any alternate suggestions ?) and I'm getting syntax errors. The statement is:
SELECT @cmdLine = CASE @BackupType WHEN 1 THEN Select @tmpStr = CASE @initFlag WHEN 1 THEN 'BACKUP Database ' + @databaseName + 'TO '+ @backupDeviceName + ' WITH INIT, NOUNLOAD, NAME = ' + @backupJobName + ' , SKIP , STATS = 10, NOFORMAT' ELSE 'BACKUP Database ' + @databaseName + 'TO '+ @backupDeviceName + ' WITH NOINIT, NOUNLOAD, NAME = ' + @backupJobName + ' , SKIP , STATS = 10, NOFORMAT' END WHEN 2 THEN Select @tmpStr = CASE @initFlag WHEN 1 THEN 'BACKUP Database ' + @databaseName + 'TO '+ @backupDeviceName + ' WITH DIFFERENTIAL, INIT , NOUNLOAD, NAME = ' + @backupJobName + ', SKIP, STATS = 10, NOFORMAT' ELSE 'BACKUP Database ' + @databaseName + 'TO '+ @backupDeviceName + ' WITH DIFFERENTIAL, NOINIT , NOUNLOAD, NAME = ' + @backupJobName + ', SKIP , STATS = 10, NOFORMAT' END WHEN 3 THEN Select @tmpStr = CASE @initFlag WHEN 1 THEN 'BACKUP Log ' + @databaseName + 'TO '+ @backupDeviceName + ' WITH INIT, NOUNLOAD, NAME = ' + @backupJobName + ', SKIP , STATS = 10, NOFORMAT' ELSE 'BACKUP LOG ' + @databaseName + 'TO '+ @backupDeviceName + ' WITH NOINIT, NOUNLOAD, NAME = ' + @backupJobName + ', SKIP , STATS = 10, NOFORMAT' END ELSE '' END
Hi i am having some trouble with a nested case statement, what i want to do is set the value of a new column called Result depending on a series of case statements. Basically i want to check Test.Webstatus = 'Rd' and FinalResult = 'true' if this is true i want it to set the value in the Results field to ReportableResult + '~' + ReportableUnitDisplay then go through all the limits fields adding either the value of the field or 'blank' onto the end of the value in the Results field, depending on if the limits field has Null or a value in it. Producing a value in the Results field similiar to: 10~kg:10:5:2:1 or 10~kg:blank:5:blank:1 etc
select ClientRef, Sample.WebStatus as SampleStatus, Analysis, FinalResult, Test.WebStatus, 'Result' = Case when Test.WebStatus = 'Rd' and FinalResult = 'true' then Case Case when UpperCriticalLimit is null then ReportableResult + '~' + ReportableUnitDisplay + ':blank' else ReportableResult + '~' + ReportableUnitDisplay + ':' + UpperCriticalLimit end Case when UpperWarningLimit is null then ReportableResult + '~' + ReportableUnitDisplay + ':blank' else ReportableResult + '~' + ReportableUnitDisplay + ':' + UpperWarningLimit end Case when LowerWarningLimit is null then ReportableResult + '~' + ReportableUnitDisplay + ':blank' else ReportableResult + '~' + ReportableUnitDisplay + ':' + UpperWarningLimit end Case when LowerCriticalLimit is null then ReportableResult + '~' + ReportableUnitDisplay + ':blank' else ReportableResult + '~' + ReportableUnitDisplay + ':' + LowerCriticalLimit end end when FinalResult = 'false' then Null else Test.WebStatus from Job inner join sample on Job.JobID = Sample.JobID inner join Test on Sample.SampleID = Test.SampleID left join Result on Test.TestID = Result.TestID
I have a Sproc. to get records and I was looking to use a nested CASE statement
The thing is that first I want to check the availability of single quote in my where statement and replace it with double quote. The second case is to check for a given condition and make some calculation. The following statement is not running. So would you mind helping me in this regard?
Thank you in advance:
(CASE WHEN CHARINDEX(''ca.caCode'',''' + replace(@WhereStmt, char(39), char(39) + char(39)) + ''') > 0 THEN ca.ClusterAmount ELSE dbo.vwGrantsMaster.CurrentValueTotalCost END CASE WHEN dbo.vwGrantsMaster.StatusCode IN (3) THEN (IsNull(dbo.vwGrantsMaster.CurrentValueTotalCost, 0))-(IsNull(dbo.vwGrantsMaster.AwardedTotalCostAmount,0)) ELSE dbo.vwGrantsMaster.CurrentValueTotalCost END) AS CurrentValueTotalCost,
Is it possible to use nested case statements in the SQL for your dataset when you are using Reporting Services? I keep getting an error saying "Unable to parse expression" and my report won't run.
I know this is quite a complex statement, so at first I was worried that maybe I had brackets in the wrong places, but I've been through the code and made sure that every opening bracket has an equivalent closing bracket, and everything appears to be OK in that respect. So I'm thinking that maybe the structure of my nested case statements is incorrect? The inner case statement is necessary to calculate whether a transaction is due, overdue or not due. The outer case statement depends on the result of the inner case statement.
Basically, we only want the calculations following the "THEN" in the outer case statement to be executed if the result of the inner case statement is "not due" and Field2 is greater than zero. If either of those criteria aren't met, then it should go straight to the ELSE NULL END statement and stop.
MSSQL 2005 Enterprise Edition version 9.00.3042.00 Windows 64 bit OS
I have started working on SQL server 2005 and realised that BIDS has not been installed, I tried to re-run setup again for integration services but I get an error saying that the version that is being installed is older than that already installed. I assuming that SP 2 has been installed (judging by the logs) Does anyone know how to install the BIDS application from the above scenario?
Hello,I am learning SQLServer 2005 Express Edition. I wanted to learn ReportDesigner which - according to my tutorial book - is part of BusinessIntelligence Development Studio. I can't find it in Internet. Couldyou help me plase?Thank you very much!/RAM/
I installed all the software that comes with sql server 2005 express including: sqlexpr.exe, sqlexpr_adv.exe, sqlexpr_toolkit.exe. All the installations were successful. However, Sql Server Business Intelligence Development Studio could not be found from start menu. I am not sure whether it got installed. I need it to develop reports. What could the problem be? Any solutions?
I just got through uninsalling the express verions of SQL2005,VB,C#&VWEB and .NET in preparation of a clean install of SQL Server 2005 Developer Edition.
I installed the developer edition of SQL Server 2005 and let it install it's own verions of .NET BI, etc. Now I see that in the install instructions for VB & C# Express requires that all verions of SQL server and .NET need to be uninstalled.
"Before installing, you must uninstall any previous Beta, CTP or Tech Preview versions of SQL Server 2005, Visual Studio 2005, and the .NET Framework 2.0."
So, does that mean I can't use any express editions of Visual Studio 2005 components with the Developer version of SQL Server Business Intelligence Development Studio (AKA - Visual Studio 2005 Version 8.0.50727.42 RTM.050727-4200)?
When I run a package I created in the development Studio it runs fine but if I create a job and run it I get an error "The AcquireConnection method call to the connection manager "ODS" failed with error code 0xC0202009"
I have the package setup to use a XML config file and it works fine on all the other packages but this one will not work.
This is a numpty question if you know the answer, but I'm not sure how to find the information I want!!!
What I would like to know is: What happens when you drag and drop a package within the SSIS Packages section of the solution explorer?
I was trying to reorder the package.dtsx files in the SSIS Packages folder but couldn't find a way to alphabetise them. I tried to drag and drop the file to the right location in the list instead, but it dissapeared from the folder display completely. What happened?
I can't see it's contents copied in the file it was dropped onto, nor did it replace the file. The package itself can still be added from the physical folder structure on the PC but it gets added at the bottom of the list.
I'm just intrigued as to what is going on. It just doesn't seem logical (something that can be said of much of my limited experience of the interface).
This view is then going to be used to update a table with only one record for each 'code'. i.e. NewTable = code, add1, add2, city, prov, postal, financialvalue, history value1, history value2
My current stumbling block is:
One of the fields in table1 is a free format address field (address). eg. could be (street addres, city prov, postal) or could be (street address 1, address2, address 3, city prov, postal)
I want to be able to assign individual components of the address to corresponding fields
if # of commas = 2 then address1 = substring(address,1, position of first comma) cityprov = substring(address,possition of first comma, position of second comman) postal = substring(address rest of field)
I have a UDF which returns the number of commas but I cannot figure out how to use either a nested case statement to parse the string...
ANy ideas on how best to accompish this? ( this table is needed for some leacy software which can only handle one record with all infor....