Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MS SQL Server


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Can I Split Matrix Into 2 Or 3 Rows?


Hi All

       I have a matrix with single row. The no. of column varies and sometimes goes to 10-15. So it goes to next page and while exporting it inserts blank pages when exported to PDF. I need the column width at least 2.5cm. I need to break the matrix to next row instead of it going to next page say after 6th or 8th column. I tried to work with the example given in the site http://blogs.msdn.com/chrishays/archive/2004/07/23/HorizontalTables.aspx by Chris Hays. But it is showing matrix for each Row Group, which doesn't meet my requirement.

       
       I had a work around which worked by putting two matrix one below the other and filtering the columns to be shown in each matrix.

If anybody faced this issue or anybody solved the issue kindy reply which will be very helpful for me.


One more doubt, Can I get the Column number of the matrix?

Thanks in advance

Dileep




View Complete Forum Thread with Replies

Related Forum Messages:
Matrix - Create Two Rows In A Matrix
Hello.
I hope to explain myself well - I want to make a matrix with two rows.
Lats say my data is this:
I hava a list of months and in every month I have a number of pepole and there age.
How can I show this in a matrix?
It need to be in a matrix since I need the columns to expand acording to the month but I don't know how to create two diffrent rows in my matrix.

The data should look like this:

          10/06     11/06     12/06     01/07     02/07     03/7     04/07   .....
num      5            1            2           5           4          5          7       .....
age      16.1       25         18.5       14.8      25.5     20.5       18.5    .....

Thanks for any help.

View Replies !
Split Rows
not sure if this is possible...

but lets say i make a select like

select products, stock from table

and my rs is

chair | 1
couch | 3
lamp | 2

is there anyway in the select to make any row that has stock of more than 1 to make a new row... so my rs would come back as

chair
couch
couch
couch
lamp
lamp

Any info would be helpful...

Thanks,

~ moe

View Replies !
How To Split Data Into Two Rows
I have a query that returns a table similar to:

State        Status          Count
CA          Complete     10
CA          Incomplete   200
NC          Complete     20
NC          Incomplete   205
SC           Incomplete   50


What sort of query will allow me to reformat the table into:

State      Complete     Incomplete
CA         10               200
NC         20               205
SC          NULL         50

View Replies !
How To Split Out Table Rows Into 3 Tables
I imported all rows of my txt file using SSIS 2005 into a table.  I am now trying to figure out how to split out the header, payment rows, and maintenance rows.  First, some information.

An example of table results is here:
http://www.webfound.net/split.txt
The table has just one field of type varcha(100) because the incoming file is a fixed length file at 100 bytes per row

The header rows are the rows with HD in them...then followed by detail rows for that header (see here http://www.webfound.net/rows.jpg).

I need to

1) Split out the header into a header table
2) Split out the maintenance rows (related to the header) into a maint table
3) Split out the payment rows (related to the header) into a payment table

I'll need to maintain a PK/FK relationship between each Header and it's corresponding maint and payment rows in the other 2 tables.

To determine if it's a payment vs. maintenance row, I need to compare chars 30 - 31.  If it contains 'MT' then you know it's a maintenance row, else it's a payment row.

How in the hell do I do this???

View Replies !
Split One Field In Multiple New Rows
HiHo,
just a beginners question:
 
I have the following row with 2 fields:

Field 1:            Task A
Field 2:´           1;2;3;4
 
The number of semicolon divided elements in Field 2 is variabel.
 
I would like to create new rows like:
 
    Row 1      Field 1:     A            Field 2:        1
    Row 2      Field 1:     A            Field 2:        2
    Row 3      Field 1:     A            Field 2:        3
    Row 4      Field 1:     A            Field 2:        4

 
I think I should use a Foreach Loop.
But I don't exactly how to do it?
 
best regards
Chris

View Replies !
How Can I Split The Rows In 2 Textboxes - Urgent
Hi,

   I have a report and its been populating from a sproc. and i have 2 text boxes called both of them are poplulated by Fields!Investment Names, but right i can display the data left to right but i want to display the Data starting top to bottom and then towards the right.

   I tried grouping the data in this way for one text box = CountRows()/2 > 10 . and this shows all the records one below the other, so is there a  way that i can display half the records in one text box and the other half in the other text box.

   I am going kinda nuts over this. Can someone please help me.

Regards

Karen

View Replies !
How To Split Columns Into Multiple Rows
SOURCE TABLE
ID DESCRIPTION
1 I am a programmer
2 I am a doctor

Destination Table

ID LINE DESCRIPTION(Varchar10)
1 1 I am a pro
1 2 grammer
2 1 i am a doc
2 2 tor


Please someone help me on this.

View Replies !
One For The SQL Gurus: Split A Delimited Field Into Rows
Hi.

I'm trying to write an SQL Query that will take a delimited field and return each item as a row.

Example

Take the AuthorizedRoles and TabID fields from the Tabs table

AuthorizedRoles TabID
0;11;__________1
0; 15 ;17;______6
-2;____________7

I would like to return a unique record for each Authorized Role

AuthorizedRole TabID
0____________1
11___________1
0____________6
15___________6
17___________6
-2___________7

Any ideas?

Cheers
Dave

View Replies !
SQL View To Split Rows In Single Table...
I've been searching the forums and Google for some help splitting up rows in a table without any luck. I'm not quite sure what to even look for

I have a table is MSSQL 2000 that looks as follows:


Code:



id custnum b1_email b2_email b1_sub b2_sub
------------------------------------------------------------------------
1 123456 b1@host1.com b2@host1.com 0 0
2 654321 b1@host2.com b2@host2.com 1 0
3 321654 b1@host3.com b2@host3.com 0 1



Now... I am hoping create a view that splits these rows up so that only a single email address is on each row. I'd like to split it up as follows:


Code:



custnum email sub
----------------------------------
123456 b1@host1.com 0
123456 b2@host1.com 0
654321 b1@host2.com 1
654321 b2@host2.com 0
321654 b1@host3.com 0
321654 b2@host3.com 1



Any help would be great! I imagine some sort of join command can be constructed using a single table?

View Replies !
How To Assign Unique PKs And FKs On Split Of Txt Rows Into DB Tables
SSIS 2005

Ok, I have a task in SSIS that does the following and works:

1) Brings in a txt file

2) Using a conditional component, checks for a value in the row.

3) Based on the value, splits the row into one of 3 tables (Header, Maintenance, or Payment)

Here is a print screen of what I have so far which splits Header rows into it's own table, Maintenance rows into its own table, and Payment Rows into its own table:

http://www.webfound.net/qst_how_to_add_header_PK_and_FKs.JPG

Here is a print screen of the conditional split:

http://www.webfound.net/conditional_split.jpg

Please take a look at the txt file here before it's processed:

http://www.webfound.net/split.txt

http://www.webfound.net/rows.jpg

Notice that the pattern is a header row, followed by it's corresponding detail rows.  The detail rows are either Maintenance or Payment rows. 

I need to somehow during the Script component or some other way, to assign a unique HeaderID (PK) to each of the header rows and add that ID to it's corresponding Maintenance and Payment detail rows in their corresponding tables as a PK.  The problem is

1) I don't know how to do this in the flow of the components as I have it now

2) How do I tell it to create a new Header ID and Header FKs for the detail rows based off of each new Header row?

In the end (much later on in my entire package), the goal is to be able to run a stored proc to join and select the Header and Details rows back into a final table so I can then do more processing such as split each header and detail rows into their own txt files, etc....I don't need to go into details why but just know that this is the goal, therefore I need to relate each header row with their corresponding detail rows that are split off into a MaintenanceRow and PaymentRowTable

 

View Replies !
Split One Row Into Multiple Rows Based On Time Elements
I'm dealing with a problem.

The record information example

DateTimeStart , DateTimeEnd , action , duration (seconds)
2007-02-02 10:30:22 , 2007-02-02 11:30:22 action1 , 600

what i want is for every half hour between start and end a record

10.30 action1
11.00 action1
11.30 action1

how can i create this, i'm a little stuck on this

View Replies !
How To Split A Delimited Column Into Mulitple Rows In The Dataflow?
I'm sure there is probably a very easy solution that I am just not seeing or can't Google...

I have a DataFlow that includes a column of Delimited values (i.e. Value1,Value2,etc..). As this DataFlow is populating a parent table, I need split the values into their own dataflow and populate a child table. I've tried a script transformation and couldn't figure out how to accept 1 delimited input row and output multiple rows after a split. Any ideas?

TIA,
Matthew

View Replies !
Is Max #rows In A Matrix 42?
my matrix is cutting off at 42 rows.  Is this the max?  Any way to override this max? 

View Replies !
Multilpe Rows In Matrix
 

      My requirement is to generate multiple columns dynamically.So I have used Matrix.It working fine.I can able to generate columns dynamically based on dealer.

 

In Data region region of matrix I have given the results of that column.But it is displying only first record of each column.In need to display all records.Please help me.

  

 

View Replies !
Rows Header In A Matrix
Hello,
In a report, I need to display headers for the hierarchy in the rows of a matrix. I have tried several things (display them above, or put them in the white box at the top left of the matrix, separated with spaces...).


Does someone know a way to have these headers displayed as the first row for example or something more "clean" than what I did.


The rows are organised as a drilldown so the perfect solution would be to display the header only when the corresponding row level is displayed.

Thanks in advance.

View Replies !
Hiding Rows In Matrix
Hi,

 

I have a report which has got 52 rows of Week1/Week52. Depending on a field Duration (no. of weeks), I want tot display only those rows. i.e. If duration is 3 then display Row of week1, week2 and week3.

 

I tried to look in the visibility properties of rows in matrix report. But there is no option. Am I doing something wrong?

 

any help will be appreciated.

 

regards

Josh

View Replies !
Header On Matrix Rows
Is there any way to add a header to a Matrix row in RS SP2? Much like a header for fields in a table.

View Replies !
Conditionally Hide 2 Out Of 6 Rows In A Matrix?
 

I just spent about 30mins searching through the forums for this and saw several posts, but I didn't find a straight answer that seems like it would work for my report.  How can I add only 2 data rows to a group (to hide them via the group's visible properties) and keep the rest of the rows outside of the group, but still in the same column (vertical area), as shown:
 
This is the view of all rows:








Cat1
Cat2

Product A
Data 1
#
#


Data 2
#
#


Data 3
#
#


Data 4
#
#


Data 5
#
#


Data 6
#
#

Product B
Data 1
#
#


Data 2
#
#


Data 3
#
#


Data 4
#
#


Data 5
#
#


Data 6
#
#
 
And this is the view I'm seeking in some cases:








Cat1
Cat2

Product A
Data 1
#
#


Data 4
#
#


Data 5
#
#


Data 6
#
#

Product B
Data 1
#
#


Data 4
#
#


Data 5
#
#


Data 6
#
#
 

View Replies !
Table And Matrix Rows Problem
I have a table and matrix placed next to each other in my report:

 

[Table displaying ProjectInfo, Revenue, etc.. ][Matrix displaying Monthly Distribution]

 

When I run the report, the result set returns say 100 rows for table and a row for each project in Matrix. The header and detail rows of table and matrix are perfectly aligned with each other, however, on the first page the table displays 47 rows and then breaks while the matrix displays 50 and breaks. On the next page the Matrix is three rows shorter. As a result the bottom of each control does not align on any page.

 

Any ideas what could be going wrong or how to fix this?

 

Thanks.

View Replies !
Matrix: Calculating Variance In Rows
1. Is it possible to use the subtotal as a field for calculating values?
2. Can I add another row to the subtotal area, having two subtotal rows?
 
I need to achieve the following output:
 
                                        Months
                                        1          2         3
101200  Cust1      2008     50        40

                           2007     45        45
                      Subtotal     +5        -5
102300  Cust2      2008     70        80

                      Subtotal       0         0
 
What I want is to use the subtotal as a variance-field for the two selected years by the user. It could happen that a customer doesn't generate turnover in one year, then the subtotal has to be 0 or 100 or whatever.
 
If my suggestions aren't applicable then I'd like to know If there is another possibility to display the desired results.
 
Thanks!

View Replies !
Matrix: How To Get The Running Difference Between Rows
Hi,
 
I am working on a matrix report shown as below: the first one is what i got now, the second one is what I desire to have
 












Quarter1

January
February
March
Total

      
CCC     
2006
9
9
19
37

2007
2
17
15
34

CHTDS   
2006
5
15
10
30

2007
6
8
9
23

FTA     
2006
4
9
3
16

2007
4
4
6
14

GDA     
2006
9
8
12
29

2007
15
7
16
38
 






 
Quarter1

January
February
March
Total

      
CCC     
2006
9
9
19
37

2007
2
17
15
34

 
 
 
Diff
-7
8
-4
-3

CHTDS   
2006
5
15
10
30

2007
6
8
9
23

 
 
 
Diff
1
-7
-1
-7

FTA     
2006
4
9
3
16

2007
4
4
6
14

 
 
 
Diff
0
-5
3
-2

GDA     
2006
9
8
12
29

2007
15
7
16
38

 
 
 
 
Diff
6
-1
4
9
How can I get the difference between 2006 and 2007 for each category as highlighted in yellow?
 
Thanks,
 
xhh

View Replies !
Matrix Sub-totals - Only Formatting Cols Not Rows
 

Hi

i'm using the following to try and highlight both the rows and columns of the sub-totals but it's only changing the column sub-totals not both as i'm after.

=iif( (inscope("matrix1_customer_") or inscope("matrix1_period") ) ,"Normal","Bold")

I'm also away to put the kettle on if anyone wants a cuppa ?

Thanks

Steven

View Replies !
Making Crossed Rows With A Matrix Object
Hello anyone!!! Can anyone helpme with this pls?
I have this data model: there is 4 tables A, B, C and D. The constraints says that a identity row in the table A is the forain key in the table B, and the same row is a forain key in the table C. The table D have two forain keys with the table C and B.
C             A         
++  <--  ++
++         ++
|             |
V             V
++  <--  ++
++         ++
D             B
I need make in a part of a report this: for each row of the table D the report have to print the row of the table C that has found by the constraint and then in the next row the report have to print the row of the table B found by the other constraint. It could looks like this:

C.field1
B.field1
The Problem that I have is that If in the table D are more rows, ie. 3, the report have to crossed sort the next rows such this

C.field1
B.field1
C.field2
B.field2
C.field3
B.field3
In the report with a matrix I have done more or less this, but not exactly that I need to implement. cuz in this way the report returns to me this:

C.field1
C.field2
C.field3
B.field1
B.field2
B.field3
anoter solution that I tried to implement is do this, in a single field write this "Fields!C1.Value & vbCrLf & Fields!B1.Value" but the problem with this is that the fields of the table B are not the same or the same number that in the table C. So this isn't the solution too.
So wonderfull developers, anyone have any idea or know how to resolve this? THX!!!

View Replies !
Freezing Multiple Rows And Columns In Matrix Control
Hi all,

I hv a matrix control in my rdl which looks like -

       Report Name

     (static row)Fund Name          =Fields!FundName.Value(Dynamic Column Header)

      (static row)Broker Name       =Fields!Broker.Value(Dynamic Column Header)

     (static row)Account No.         =Fields!AccountNo.Value(Dynamic Column Header)

    ---then other static rows    

now i want these 3 column header's and there corresponding static rows should be freeze.

Can anyone suggest me any solution for this.

I can use either RS 2000 or RS 2005 

View Replies !
Matrix That Adds A New Column After 5 Rows Are Filled With Data
Hello,

I have a report in wich I show a list of countries. The length of this list differs each month and comes from a SSAS datasource.
I want to show this list on my report in a matrix like this:

country1 country6 country11
country2 country7 country12
country3 country8
country4 country9
country5 country10

How can I do this? I need some sort of check that counts the number of countries added and then adds a new column after 5 countries.

I'm sure there is somebody that did this or knows how to do this.

Thanks in advance!

Jorg.

View Replies !
Controlling Number Of Rows To Display In A Table And Matrix On One Page
Is there a way to control how many Detail Rows are displayed on one page in Table and Matrix controls?

View Replies !
How Do I Show All Columns In A Matrix Even If There Are No Data Rows Using The Column On A Given Page?
I have one column in a matrix component and it has about 7 items, but the only the items which have values on the page appear at the top of that page. 

 

This is for a labratory so the columns are the different Patient Types and the rows are the different Test Mnemonics.  If one of the Patient Types is not used in any of the tests on that page, it doesnt show up.  How to I make sure all Patient Types show up on every page?

 

Thank you all.

View Replies !
Dataset Into A Table Or Matrix With Fixed Number Of Columns, Variable Rows
Hi

   I have a dataset with 2 columns, a rownumber and a servername - eg

 

rownumber servername

1                  server1

2                  server2

....

15               server15

 

   I want to display the servernames in a report so that you get 3 columns - eg

 

server1 | server2 | server3

server4 | server5 | server6

...

server13 | server14 | server15

 

   I have tried using multiple tables and lists and filtering the data on each one but this then makes formating very hard - i either end up with a huge gap between columns or the columns overlap

 

   I have also tried using a matrix control  but cant find a way to do this.

 

   Does anybody know an easy way to do this? The data comes from sql 2005 so i can use a pivot clause on the dataset if somebody knows a way to do it this way. The reporting service is also RS2005

 

Thanks

 

Anthony

 

View Replies !
Suppress Rows With No Data In Matrix Report - Visual Studio 2003
I would like to suppress all of the rows in my Matrix report that have either NULL or 0 data.  I know how to apply a filter in a table report to accomplish this.  However, I'm not sure how to do this in with a matrix because I need to filter if the subtotal in the row is 0, and the subtotal is generated by Visual Studio. There is 1 data value which expands across 4 columns with a subtotal at the end of the row.  I tried referencing the subtotal at the end of the row with a "Report!Item" expression, but Visual Studio tells me I can't reference a "Report!Item" in a filter.  Does anyone know how to do this with Visual Studio 2003? 

Note:  My data is coming from an AS400 file.  For simplicity, It consists of a description, an amount, and a flag which indicates a category.  The category flag is the grouping across the top, the descripion is down the side of the report. 

Data sample:
desc.      amount    category
paper        5.00        1
paper        7.00        2
paper        4.00        3
paper        6.50        4

Matrix:
descr            1        2      3      4        Total
Paper        5.00    7.00  4.00  6.50    22.50

Thank you,  PB 

View Replies !
Matrix Column Problem - Need Multiple &&"subtotal&&" Like Rows
I've got what I thought was a fairly simple matrix request, but just can't seem to do it in reporting services.

In the rows, things are grouped by campaign. In the columns, things are grouped by district. Something like this:



Area1    Area2    Area3   Total
CampaignType1          1           2          3         6    
CampaignType2          2           4          1         7
CampaignType3          3           3          1         7
Total                          6           9          5


Campaign and Area are all selectable by parameters, so the actual number of rows is dynamic.
What I would like to do is an additional aggregates other then sum for the total - things like average, percent to goal, etc.





Area1    Area2    Area3   Average    % attained    Total
CampaignType1          1           2          3           2                  60%       6    
CampaignType2          2           4          1           2.33              70%       7    
CampaignType3          3           3          1           2.33              70%       7    
Total                          6           9          5



And this is where, either I'm completely missing something, or SSRS and I have a huge communication breakdown . I absolutely cannot seem to do this. I tried adding additional columns, but they are grouped under area, not after it - in the above example, it would result in three new columns, one for each area type, not 1. Confusing to describe, but looks something like:




Area1            Area2        Area3          Total
Sum  Avg      Sum  Avg   Sum  Avg CampaignType1          1      xx   
CampaignType2          2      yy  
CampaignType3          3      zz   
Total


I hope that conveys the idea w/o having to fill it all in.

I'm lost as to how to get this accomplished. All I can think of is adding a union dummy row into the actual stored proc to make a different area type (say, AreaAverage) just to add in an additional column and that make sure it sorts at the end. That screams hack to me. Any help????

View Replies !
A Matrix Above Two Charts. Right Chart Moves Depending On Matrix Growth ... ???
I have a Matrix table that expands to the right when choosing an amount of months to be shown. Under this matrix I have to Charts. The two charts are situated together, that is no space between them, and to the left of the report.
 
Now, if I choose a lot of months, say three years the matrix diagram will be huge to the right. The problem I have is that the second diagram, the one on the right, moves to the right depending on how big the report gets, and this is not good at all. The two charts are supposed to be all the way to the left.
 
How? Why does the right chart move?
 
Thanks in advanced
Kind Regards
 

View Replies !
Filtering Through Matrix Or Groups In Matrix
I have a report thats fully functional. I just want to add a filter so that my "Visits" field only displays the Visits per day that are less then 6. When i try to filter out the matrix or the group, it tells me the datatypes are different . Something about int32. Its in a matrix, but i have seen this happen in a table too, so i guessing thats not the problem. I just want to be able to display the information for Sales Reps with less then 6 Visits. Any help, will be greatlly appreciated.

View Replies !
Adding Columns To A Matrix Report That Don't Belong To The Matrix Columns Groups
Can we do this?



Adding more columns in a matrix report that don€™t
belong to the columns drilldown dimensions€¦



That is, for example, having the following report:

                Product Family

               
Product    

Country  City   Number of units sold





Then I
would add some ratios, that is, Units Sold/Months (sold per month) and other that
is the average for Product Family (Units Sold/Number of  Product Family), for putting an example€¦ some
columns should be precalculated prior to the report so do not get into it, the
real problem I don€™t see how to solve is adding one or two columns for showing
these calculated column that doesn€™t depend on the column groups but they do
for the rows groups€¦




Any guidance
on that?


The only
way I am seeing by now is to set it as two different reports, and that is not
what my client wants€¦





 
Many
thanks,
Jose

View Replies !
Second Matrix Blanks Out First Matrix
Hello,

 

I have a matrix in my report that is based on an MDX query. I copy-paste the matrix and then see the two matrices in the report and all is fine.

I then insert a group into the second matrix. When I run the report  the second matrix appears as I would expect, but the cells are blank in the first matrix.  Sometime all the data cells are blank, but not the totals.

I tried a similair thing with a table. I added a table based on the same MDX dataset and the cells in the matrix were also then blanked out.

 

I made sure that the matrices were not sitting on top of each or even in the same space.

 

The goal here is to show the same dataset but with different groupings. I thought of doing drilldowns, drillthroughs, etc. but this is the way they want to see the data.

 

Any ideas what I am doing wrong?

 

Thank you for the help.

 

-Gumbatman

View Replies !
Passing Expansion Properties Of Matrix Report To &&"Jump To&&" Matrix Report
I'm dealing w/ SSRS 2005.
 
I have my main matrix report which has two textboxes that act as expansion/collapse "objects" for the fourth and fifth row groups.
 
On my column headers, I have a navigation "jump to" report. 
 
How can I pass to this "jump to" report the boolean (or whatever) property that either my 4th or 5th (or both) row groups were expanded and now my "jump to" report has the same thing.
 
I was going to use a report parameter for this, but when you go to "Edit Group/Visibiltiy", the "Visibiltiy can be toggled by another report item" doesn't even list parameters...just text boxes.
 
Basically, the goal is that whatever the user has expanded on the main report, the "jump to" report will have the same expansions.
 
Thanks!

View Replies !
Rows Skipped Out In Stored Procedure While Return All Rows If Query Executed Seprate
Hi All,

I am using sql server 2005. I stuck out in a strange problem.
I am using view in my stored procedure, when I run the stored procedure some of the rows get skipped out means if select query have to return 10 rows then it is returning 5 rows or any other but not all, also the records displyaing is randomly coming, some time it is displaying reords 12345 next time 5678, other time 2468.

But if I run seperately the querys written in SP then it returns all the rows. Please give me solution why it is happening like this.

There are indexes in the tables.

Once I shrink the database and rebuild the indexes, from then this problem is happening. I have rebuild the indexes several time, also updated the statistics but nothing improving.


But nothing is improving

View Replies !
To Validate # Of Excel Rows(source) And Sql Server Table(destination) Rows Are Equal
Hi,
 
When expoting data from excel to sql server table, using SSIS package, after exporting is done, how would i check source rows are equal to destination rows. If not to throw an error message.
 
How can we handle transactions in SSIS
1. when some error/something happens during export and the # of rows are not exported fully to destination, how to rollback the transaction in SSIS. 
 
Any sort of help would be highly appreciated.
 
Thanks,
 

View Replies !
To Validate # Of Excel Rows(source) And Sql Server Table(destination) Rows Are Equal
Hi,
 
When expoting data from excel to sql server table, using SSIS package, after exporting is done, how would i check source rows are equal to destination rows. If not to throw an error message.
 
Any sort of help would be highly appreciated.
 
Thanks,
 

View Replies !
Arranging Data On Multiple Rows Into A Sigle Row (converting Rows Into Columns)
Hello,
I have a survey (30 questions) application in a SQL server db. The application uses several relational tables. The results are arranged so that each answer is on a seperate row:
user1   answer1user1   answer2user1   answer3user2   answer1user2   answer2user2   answer3
For statistical analysis I need to transfer the results to an Excel spreadsheet (for later use in SPSS). In the spreadsheet I need the results to appear so that each user will be on a single row with all of that user's answers on that single row (A column for each answer):
user1   answer1   answer2   answer3user2   answer1   answer2   answer3
How can this be done? How can all answers of a user appear on a single row
Thanx,Danny.

View Replies !
Compare Values In Consecutive Rows And Print Rows Based On Some Conditions
 I have the following variables VehicleID, TransactDate, TransactTime, OdometerReading, TransactCity, TransactState.

VehicleID is the unique vehicle ID, OdometerReading is the Odometer Reading, and the others are information related to the transaction time and location of the fuel card (similar to a credit card).

The records will be first grouped and sorted by VehicleID, TransactDate, TransactTime and OdometerReading. Then all records where the Vehicle ID and TransactDate is same for consecutive rows, AND TransactCity or TransactState are different for consecutive rows should be printed.

I also would like to add two derived variables.

1. Miles will be a derived variable that is the difference between consecutive odometer readings for the same Vehicle ID.

2. TimeDiff will be the second derived variable that will categorize the time difference for a particular vehicle on the same day.

My report should look like:

VehID  TrDt       TrTime    TimeDiff  Odometer  Miles  TrCity    TrState
1296   1/30/2008  08:22:42  0:00:00   18301     000    Omaha     NE
1296   1/30/2008  15:22:46  7:00:04   18560     259    KEARNEY   NE

Can someone please help me here?

Thanks,
Romakanta

View Replies !
How To Create A Trigger Such That It Can Delete The Rows Whenever Any Other Application Such As Biztalk Had Read The Rows ?
I had created a trigger which sees that whether a database is updated if it is its copy the values of the updated row into another control table now I want to read the content of control_table into BIzTalk and after reading I want to delete it.Can any one suggest the suitable ay to do this?

View Replies !
Ssis Package Design To Load Only Rows Which Are Changed From Exisiting Rows.
Hi  i tried designing a SSIS package which  loads  only those rows  which were different from existing  rows in the table ,  i need to  timestamp the existing row   with  an inactive date   when a update of that row is inserted (ex: same  studentID )
and  the newly inserted row with a insert  time stamp
so as to indicate the new row as currently active, in short i need to maintain history and  current rows in same table , i tried using slowly changing dimension  but could not figure out,  anyone experience  or knowledge  regarding the Data loads please respond.
 
example of Data would be like
 
exisiting data
 
StudentID    Name      AGE   Sex   ADDRESS  INSERTTIME      UPDATETIME
12               DDS       14      M       XYZ ST        2/4/06                    NULL
14                hgS        17      M      ABC ST         3/4/07                     NULL
 
 
New row  to insert would be
 
12        DDS            15    M      DFG ST         4/5/07
 
the data should reflect
 
StudentID    Name      AGE   Sex   ADDRESS  INSERTTIME      UPDATETIME
12               DDS       14      M       XYZ ST        2/4/06                    4/5/07
 
12               DDS       15      M      DFG ST         4/5/07                     NULL
 
14                hgS        17      M      ABC ST         3/4/07                     NULL
 
Please   provide your input  as much as you can  even though it might not be a 100% solution.
 
 
 
 
 
 
 

View Replies !
Using SSIS 2005 To Strip Out Bad Rows In Excel And Then Insert Detailed Rows Into OLE DB Data Source
Environment:
 
Running this code on my PC via VS 2005
.Net version 2.0.50727 on the server (shown in IIS)
Code is in ASP.NET 2.0 and is a VB.NET Console application
SSIS 2005
 
Problem & Info:
 
I am bringing in an Excel file.  I need to first strip out any non-detail rows such as the breaks you see with totals and what not.  I should in the end have only detail rows left before I start moving them into my SQL Table.  I'm not sure how to first strip this information out in SSIS specfically how down to the right component and how to actually code the component to do this based on my Excel file here: http://www.webfound.net/excelfile.xls

Then, I assume I just use a Flat File Source coponent or something to actually take the columns in the Excel and split into an OLE DB Datasource to shove each column into a corresponding column in my SQL Server Table.  I have used a Flat File Source in the past to do so with a comma delimited txt file but never tried with an Excel.
 
Desired Help:

 
How to perform
 
1)       stripping out all undesired rows
2)       importing each column into sql table

View Replies !
Retriving Previous 5 Rows And Next 5 Rows And The Searched Record
Dear All

I have a table with the following structure in sql server 2005

create table app(
sno int,
name varchar(50),
add varchar(50),
city varchar(50),
state varchar(50)
)

it contains the follwing data
------------------------------------------
sno name add city state
------------------------------------------
1 mark street no1 newcity newstate
2 mark street no1 newcity newstate
3 mark street no1 newcity newstate
4 mark street no1 newcity newstate
5 mark street no1 newcity newstate
6 mark street no1 newcity newstate
7 mark street no1 newcity newstate
8 mark street no1 newcity newstate
9 mark street no1 newcity newstate
10 mark street no1 newcity newstate
11 mark street no1 newcity newstate
12 mark street no1 newcity newstate
13 mark street no1 newcity newstate
14 mark street no1 newcity newstate
15 mark street no1 newcity newstate
16 mark street no1 newcity newstate
17 mark street no1 newcity newstate
18 mark street no1 newcity newstate
19 mark street no1 newcity newstate
20 mark street no1 newcity newstate

----------------------------------------

I want to retrive previous 5 records, next 5 records and the record that meet the where condition of a select query.


When I run

select sno,add,name,city,state from app where sno=7

I want the following result

------------------------------------------
sno name add city state
------------------------------------------
2 mark street no1 newcity newstate |
3 mark street no1 newcity newstate |
4 mark street no1 newcity newstate | -- previous 5 records
5 mark street no1 newcity newstate |
6 mark street no1 newcity newstate |
7 mark street no1 newcity newstate --- searched record
8 mark street no1 newcity newstate |
9 mark street no1 newcity newstate |
10 mark street no1 newcity newstate |--- next 5 records
11 mark street no1 newcity newstate |
12 mark street no1 newcity newstate |
----------------------------------------

if there is a method to get the above result set, kindly post the query.

View Replies !
Name Split
Quick question.

I've got a CHAR (70) field called NAME that has a first and last name separated by a space. I want to split it into two fields FIRST and LAST -- with all the characters to the left of the space a first name and all the characters to the right of the space as last name. I couldn't find a string function that would let me do this simply (it may be right in front of me and I missed it).

Thanks in advance.

Ray

View Replies !
Name Split
I need to split a column of Full Names into First name and Last name columns. Has someone come across this before and if so can you give me an idea of how to overcome it?

View Replies !
Split Value In Sql
Hi to all

I have one problem regarding sp and pass value in sp
I am gating a value like Abc,Def,Ghi,

Now I want to split the whole pass value by “,�
And fire one for loop to store value in database
This things is done in asp.net web form but I want to do all process in sp
So please guide me how I am write sp .
The purpose is pass value one time so connection time is decrees and give fast perforce

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved