MS SQL - Add column with all rows being "0"

Add column with all rows being "0"

nevermind
"lee" <[email protected]> wrote in message
news:e3b5kt$mch$[email protected]..
> Add column with all rows being "0"
>
>
>

Similar Messages

  • Match values of 2 columns with other rows

    I want to compare the values of 2 columns with all rows in the sheet.
    If there is a match I want to place a character in the next column, so I can filter on it
    But I need to keep one row for each unique value. (match of 2 columns)

    Hi,
    I'm marking the reply as answer as there has been no update for a couple of days.
    If you come back to find it doesn't work for you, please reply to us and unmark the answer.
    Thanks
    George Zhao
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click "[email protected]"

  • Add column with preq number to ALV grid in me53n

    hi all,
    i am trying to add column with preq number (BANFN) to ALV with preq items in ME53N. it is not available in column set, when trying to add by "change layout" button - i dont understand why, when the strcucture MEREQ3211GRID contains it :-(
    i also tried to add new field ZZBANFN into the structure CI_EBANMEM and after that, i could add the new field to ALV through change layout, but it was empty of course. so i implemented EXIT_SAPLMEREQ_001 from MEREQ001, but ZZBANFN is still empty, because this exit is not called when opening ME53N, but when clicking on tab "customer data" in preq item detail.
    how to solve this? is there any exit that is called before displaying the ALV grid?

    Here is some more detail. I included my code from the Enhancement.
    ENHANCEMENT-POINT MM06EFPO_POT_AUFBAUEN_02 SPOTS ES_MM06EFPO_POT_AUFBAUEN INCLUDE BOUND.
       ENHANCEMENT 1  Z_MM06EFPO_POT_AUFBAUEN_1.    "active version
      SELECT SINGLE zz_old_material FROM mara
        INTO pot-zz_old_material
        WHERE matnr = pot-matnr.
    ENDENHANCEMENT.
    You will also need to change the layout in Item Overview to bring your field in.

  • PL/SQL add procedure with nested table - Duplicate Thread

    Hi,
    I am trying to do a procedure to input information for one order and another for 2 orders.
    The information I have so far is as follows:
    Drop table Orders cascade constraints;
    Drop type item_type;
    Drop type Item_nested;
    Create or Replace Type item_type AS Object (
    Cat_code Varchar2(6),
    Amount_ord Number(3),
    Cost Number(5,2) );
    Create or Replace Type item_nested as table of item_type;
    Create Table Orders (
    Order_no Varchar2(8) constraint pkorder primary key,
    Customer_name Varchar2(30),
    AddressLine1 Varchar2(20),
    AddressLine2 Varchar2(20),
    AddressLine3 Varchar2(20),
    Town Varchar2(20),
    Postcode Varchar2(10),
    Country Varchar2(20),
    Order_items item_nested,
    Order_date Date)
    Nested Table Order_items
    Store as nested_items return as locator;
    This has so far worked but I have not managed the insert procedure.
    I am using Oracle SQL*plus
    Thanks
    SG
    Edited by: user10689875 on 11-Jan-2009 03:39

    Duplicate thread ->
    PL/SQL add procedure with nested table
    Please remove it & marked it as duplicate.
    Regards.
    Satyaki De.

  • Merging two columns with muliple rows in Numbers '09

    I am trying to merge two columns each with 100 rows and related data. Column one is the street address and column two have office numbers. The final result would be one column with 100 rows with address and office numbers.
    Ed Carreon

    sanpanza wrote:
    I am trying to merge two columns each with 100 rows and related data. Column one is the street address and column two have office numbers. The final result would be one column with 100 rows with address and office numbers.
    Ed Carreon
    Hi Ed,
    Use the CONCATENATE() function.
    Street address in column D, Office number in Column E
    100 Smith ST            212
    Formula: =CONCATENATE(E," ",D)
    Result:
    212 100 Smith ST
    Note the formula has three arguments, the reference to column E, a text literal (" ") containing a single space, and a reference to column D.
    Regards,
    Barry

  • Add column with row number to table

    Hi,
    to a table view I'd like to add a new column that contains the row number for each row.
    I have many data sources (twelve) and with the union operator I create one output dataset. The output data is sorted by the arrangement of the input ports of the union operator.
    Is there a way to add a column with its corresponding entry number?
    Regards, FT

    I have a similar question to the original post. It seems your answer will fill the new field in all rows with the same value. But, what if we want an actual row number?
    I am simply looking to add a row number to a table. I only have one data source. The business scenario is that the output of the data service is sorted in descending order on value. I want to be able to select the first 10 (i.e. the top 10 items based on that value).
    Even if I can solve my business scenario without using a row number field after the sort, it seems like a technique that would come in handy. 
    Any ideas? I'm pretty new to using Visual Composer so I may be missing something obvious.

  • Best way to give a default value to a New Column with existing rows

    Adding some columns to SQL tables with existing data rows. There are also views created from these tables. The views are used in some report/query software so NULL values are not good. Interested in learning about the best way to set a default value. 
    These are the ways that I can think of
    1) ALTER TABLE using the DEFAULT to add the column and set the default value
    ++ Adds a constraint which is not terrible. Constraints are just not used much in this shop.
    2) ALTER TABLE to add the column then do an UPDATE statement to update the values
    ++ might be an issue for tables with millions of rows
    3) ALTER TABLE to add the column then use ISNULL in the CREATE VIEW

    It is a large table with 444 columns and max row size of 2268. 907k records took 1 minute 38 seconds to UPDATE the column. I have about 12 fields to add to this table and about 44 tables (not all this large of course) so it will take some time to
    UPDATE.  Although ... i just tried updating 3 columns in a single UPDATE and it took 1 minute 36 seconds. So If I did all 12 fields in a single UPDATE it would be about the same time as a single Field.  I will think about it.

  • AdvancedDataGrid - Add columns with ActionScript

    I'm trying to add columns to an AdvancedDataGrid via ActionScript.
    I can't get it to work.
    I've tried two approaches -- One with an intermediary array to store the columns then set the adg's columns to the array; One where I assign the columns directly to the adg's columns array.
    They both fail in their own way.  The columns don't "take" and the adg uses the dataProviders defaults, or there are no columns at all.
    "adg_test.mxml" has the AdvancedDataGrids/code. 
    "adg_test_renderer.mxml" is a renderer for one of the columns.
    Would appreciate learning what I'm doing wrong.
    Thanks for any help.
    === START adg_test_renderer.mxml  ===
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">
         <mx:Button id="btnTest" label="Renderer Working"/>
    </mx:VBox>
    === END adg_test_renderer.mxml  ===
    == START adg_test.mxml ====
    <?xml version="1.0"?>
    <mx:Application
        xmlns:mx="http://www.adobe.com/2006/mxml"
        initialize="init()">
        <mx:Script>
          <![CDATA[
             import mx.collections.ArrayCollection;
             [Bindable]
             private var dpADGExplicit:ArrayCollection = new ArrayCollection([
               {Artist:'Pavement', Album:'Slanted and Enchanted', Price:11.99},
               {Artist:'Pavement', Album:'Brighten the Corners', Price:11.99},
               {Artist:'Saner', Album:'A Child Once', Price:11.99},
               {Artist:'Saner', Album:'Helium Wings', Price:12.99},
               {Artist:'The Doors', Album:'The Doors', Price:10.99},
               {Artist:'The Doors', Album:'Morrison Hotel', Price:12.99},
               {Artist:'Grateful Dead', Album:'American Beauty', Price:11.99},
               {Artist:'Grateful Dead', Album:'In the Dark', Price:11.99},
               {Artist:'Grateful Dead', Album:'Shakedown Street', Price:11.99},
               {Artist:'The Doors', Album:'Strange Days', Price:12.99},
               {Artist:'The Doors', Album:'The Best of the Doors', Price:10.99}
             [Bindable]
             private var dpADGActionScript:ArrayCollection = new ArrayCollection([
               {Artist:'Pavement', Album:'Slanted and Enchanted', Price:11.99},
               {Artist:'Pavement', Album:'Brighten the Corners', Price:11.99},
               {Artist:'Saner', Album:'A Child Once', Price:11.99},
               {Artist:'Saner', Album:'Helium Wings', Price:12.99},
               {Artist:'The Doors', Album:'The Doors', Price:10.99},
               {Artist:'The Doors', Album:'Morrison Hotel', Price:12.99},
               {Artist:'Grateful Dead', Album:'American Beauty', Price:11.99},
               {Artist:'Grateful Dead', Album:'In the Dark', Price:11.99},
               {Artist:'Grateful Dead', Album:'Shakedown Street', Price:11.99},
               {Artist:'The Doors', Album:'Strange Days', Price:12.99},
               {Artist:'The Doors', Album:'The Best of the Doors', Price:10.99}
            private function init():void
                var arr:Array=[];//Intermediary array that will become the AdvancedDataGridColumn array
                var col:AdvancedDataGridColumn = new AdvancedDataGridColumn();
                col.dataField = "Artist";
                arr.push(col);
                col.dataField = "Album";
                col.visible = false;
                arr.push(col);
                col.dataField = "Price";
                col.itemRenderer = new ClassFactory(adg_test_renderer);
                arr.push(col);
                adgActionScript.columns = arr;
                //ALTERNATE UNSUCCESFUL APPROACH
                col.dataField = "Artist";
                adgActionScript.columns.push(col);
                col.dataField = "Album";
                col.visible = false;
                adgActionScript.columns.push(col);
                col.dataField = "Price";
                col.itemRenderer = new ClassFactory(adg_test_renderer);
                adgActionScript.columns.push(col);
          ]]>
        </mx:Script>
        <mx:Label text="Explicit Columns"/>
        <mx:AdvancedDataGrid
            id="adgExplicit"
            width="100%" height="100%"
            sortExpertMode="true"
            dataProvider="{dpADGExplicit}">
            <mx:columns>
                <mx:AdvancedDataGridColumn dataField="Artist" />
                <mx:AdvancedDataGridColumn dataField="Album" visible="false"/>
                <mx:AdvancedDataGridColumn dataField="Price" itemRenderer="adg_test_renderer"/>
            </mx:columns>
       </mx:AdvancedDataGrid>
       <mx:Label text="ActionScript Columns (If ActionScript works: Arist column should be hidden. Should see Album column with data and Price column with buttons."/>
        <mx:AdvancedDataGrid
            id="adgActionScript"
            width="100%" height="100%"
            sortExpertMode="true"
            dataProvider="{dpADGActionScript}">
       </mx:AdvancedDataGrid>
    </mx:Application>
    == END adg_test.mxml ====

    Thanks so much for your help.
    Here's how I altered your code for my example.  This logic allows easier assignment of additional column parameters.
    === START adg_test_renderer.mxml  ===
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">
        <mx:Button id="btnTest" label="Renderer Working"/>
    </mx:VBox>
    === END adg_test_renderer.mxml  ===
    == START adg_test.mxml ====
    <?xml version="1.0"?>
    <mx:Application
        xmlns:mx="http://www.adobe.com/2006/mxml"
        initialize="init()">
        <mx:Script>
          <![CDATA[
             import mx.collections.ArrayCollection;
             [Bindable]
             private var dpADGExplicit:ArrayCollection = new ArrayCollection([
               {Artist:'Pavement', Album:'Slanted and Enchanted', Price:11.99},
               {Artist:'Pavement', Album:'Brighten the Corners', Price:11.99},
               {Artist:'Saner', Album:'A Child Once', Price:11.99},
               {Artist:'Saner', Album:'Helium Wings', Price:12.99},
               {Artist:'The Doors', Album:'The Doors', Price:10.99},
               {Artist:'The Doors', Album:'Morrison Hotel', Price:12.99},
               {Artist:'Grateful Dead', Album:'American Beauty', Price:11.99},
               {Artist:'Grateful Dead', Album:'In the Dark', Price:11.99},
               {Artist:'Grateful Dead', Album:'Shakedown Street', Price:11.99},
               {Artist:'The Doors', Album:'Strange Days', Price:12.99},
               {Artist:'The Doors', Album:'The Best of the Doors', Price:10.99}
             [Bindable]
             private var dpADGActionScript:ArrayCollection = new ArrayCollection([
               {Artist:'Pavement', Album:'Slanted and Enchanted', Price:11.99},
               {Artist:'Pavement', Album:'Brighten the Corners', Price:11.99},
               {Artist:'Saner', Album:'A Child Once', Price:11.99},
               {Artist:'Saner', Album:'Helium Wings', Price:12.99},
               {Artist:'The Doors', Album:'The Doors', Price:10.99},
               {Artist:'The Doors', Album:'Morrison Hotel', Price:12.99},
               {Artist:'Grateful Dead', Album:'American Beauty', Price:11.99},
               {Artist:'Grateful Dead', Album:'In the Dark', Price:11.99},
               {Artist:'Grateful Dead', Album:'Shakedown Street', Price:11.99},
               {Artist:'The Doors', Album:'Strange Days', Price:12.99},
               {Artist:'The Doors', Album:'The Best of the Doors', Price:10.99}
            private function init():void
                var arrCols:Array = adgActionScript.columns;
                var col:AdvancedDataGridColumn;
                col = new AdvancedDataGridColumn;
                col.dataField = "Artist";
                arrCols.push(col);
                col = new AdvancedDataGridColumn;
                col.dataField = "Album";
                col.visible = false;
                arrCols.push(col);
                col = new AdvancedDataGridColumn;
                col.dataField = "Price";
                col.itemRenderer = new ClassFactory(adg_test_renderer);
                arrCols.push(col);   
                adgActionScript.columns = arrCols;
                adgActionScript.validateNow();
          ]]>
        </mx:Script>
        <mx:Label text="Explicit Columns"/>
        <mx:AdvancedDataGrid
            id="adgExplicit"
            width="100%"
            height="100%"
            dataProvider="{dpADGExplicit}">
            <mx:columns>
                <mx:AdvancedDataGridColumn dataField="Artist" />
                <mx:AdvancedDataGridColumn dataField="Album" visible="false"/>
                <mx:AdvancedDataGridColumn dataField="Price" itemRenderer="adg_test_renderer"/>
            </mx:columns>
       </mx:AdvancedDataGrid>
       <mx:Label text="ActionScript Columns"/>
        <mx:AdvancedDataGrid
            id="adgActionScript"
            width="100%"
            height="100%"
            dataProvider="{dpADGActionScript}">
       </mx:AdvancedDataGrid>
    </mx:Application>
    == END adg_test.mxml ====

  • Multiple columns with uneven rows

    Good Evening Everybody
    Could somebody advise me on the best solution to do the following.
    I have a csv file. The csv file is being read using "read from spreadsheet file" vi.
    The file contains multiple columns. The columns all have a different last row address. By this I mean that...say...the last row of column 1 is 5. Column 2 last row is 23, Column 3 last row is 12. etc. The file might look like the following...note...this is an example of a file only, and any implications can't be construed.
                Column1    Column2    Column3    Column4     Column5
    Row1        0               1                 2             3                 4
    Row2       12             23              13            34                 0
    Row3       11             44              23                               11
    Row4       34             55            
    Row5       21           
    Lets assume that the value(s) of interest are contained in columns 2,4 and 5. Therefore the values I want to extract would be 55, 34 and 11
    I can select the columns of interest fine, but am having difficulty working out how to find the last row for these columns
    Caveats:
    1. The number of columns changes
    2. Position of column in file changes address...never found in same address
    Does anybody know how I might be able to locate the last row in the column of my choosing.
    Thanks for any assistance.
    best regards
    Ray

    Hi Ray,
    load the csv as an array of strings. Empty cells will result in empty strings. So you can easily test each column for an empty item, which will mark the "End of Data"...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • GTX 970 vs. 980 - do perf benchmarks exists comparing these two with all else being equal?

    Do stats exist comparing these two directly in APP (all else being equal)?
    Have a defective 970 and considering a 980, but wondering if it's worth the extra cost. In other words, does the extra cost yield significant real world performance gains in APP?

    I don't believe so, however the price difference is pretty big. Where I live it's around €350 for the 970, €450 for the 780 ti and €550 for the 980. It would seem that (at least for the time being) the 780 ti is on par if not slightly faster than the gtx 980. I am not entirely sure how much upcoming drivers and better future support for Maxwell might help it swing in favour for the 980, however I do believe the 970 to hit a solid sweet spot. It might depend on the rest of your system configuration, was the defective 970 DOA or did you manage to run it for a while to see if your setup managed to max out the gpu?
    Keep in mind if anyone reading this starts to consider choosing between the 780 ti that it does use more power and doesn't come with hdmi 2.0.

  • How to Add column with default value in compress table.

    Hi ,
    while trying to add column to compressed table with default value i am getting error.
    Even i tried no compress command on table still its giivg error that add/drop not allowed on compressed table.
    Can anyone help me in this .
    Thanks.

    Aman wrote:
    while trying to add column to compressed table with default value i am getting error.This is clearly explain in the Oracle doc :
    "+You cannot add a column with a default value to a compressed table or to a partitioned table containing any compressed partition, unless you first disable compression for the table or partition+"
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#sthref5163
    Nicolas.

  • Scan table for columns with all unqiue rows

    this is the best I could do think of so far which doesnt work, I dont know how to convert the literal column name to a reference to the column
    SELECT g.table_name, g.column_name
    FROM all_tab_columns g
    WHERE g.table_name = 'SA_AREA' and NOT EXISTS (
    SELECT g2.column_name
    FROM all_tab_columns g2
    WHERE 1 !=
    (SELECT COUNT (*)
    FROM all_tab_columns g3
    --i know this part is wrong for sure
    WHERE g2.column_name = g3.column_name
    AND g2.table_name = g3.table_name
    AND g.column_name = g2.column_name
    AND g.table_name = g2.table_name))
    thanks for your help

    Hello nwill,
    I think that .. you want something like this
    create table TEST_(COL1 VARCHAR2(30) not null,
                       COL2 NUMBER,
                       COL3 VARCHAR2(10));
    alter table TEST_ add constraint PK_COL1 primary key (COL1);
    alter table TEST_ add constraint UK_COL3 unique (COL3);
    SELECT TABLE_NAME
         , COLUMN_NAME
      FROM ALL_CONS_COLUMNS
    WHERE CONSTRAINT_NAME IN
           (SELECT CONSTRAINT_NAME
              FROM ALL_CONSTRAINTS
             WHERE CONSTRAINT_TYPE IN ('P', 'U')) -- (P) primary key and (U) unique
       AND TABLE_NAME IN (SELECT TABLE_NAME
                            FROM ALL_ALL_TABLES
                           WHERE OWNER = 'SCOTT')ouput
    TABLE_NAME                     COLUMN_NAME
    TEST_                          COL3
    TEST_                          COL1Hope this helps
    Christian Balz

  • Sql Transposing Column Name in Row

    i am using Sql Server 2008
    tbl_EmployeeProfile
    EmployeeId EmployeeName LeaveApplicable Active
    1 Sam true true
    2 Rahul false false
    3 Sameer true true
    tbl_MasterLeave
    id LeaveCode Description active
    1 PL Paid Leave true
    2 CL Casual Leave true
    3 SL Sick Leave false
    tble_LeaveAllocation
    EmployeeId Period 1 2 3 .........31
    1 2014 18 4
    3 2014 20 4
    note: tble_Masterleave.id = tble_LeaveAllocation.1( column Name)
    i.e  value of tbl_masterleave id is mape with column name of tble_LeaveAllocation 1,2,.....31
    Expected out put
    EmployeeId EmployeeeName Period PL CL
    1 Sam 2014 18 4
    3 Sameer 2014 20 4
    Note: show only record who is active = true & leaveApplicable = true  .
    why i made this table structure  because non of organization leave type are not fixed, so user can customize leave according their requirment , so i made tbl_ allocation table with 1 to 31 column , so user can allocate leave type max 31.
    please advice me is it right method or any other good alternative solution 
    Thanks Best Regard Naweez

    Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your data. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal data. We need
    to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL. And you need to read and download the PDF for: 
    https://www.simple-talk.com/books/sql-books/119-sql-code-smells/
    Why are you so special that you do not have to post DDL? I Googled you and got nothing that would grant you privilege. 
    You have the manners of a pig and your code is garbage. Look up tibbling in the “code smells” paper. That is what we call your “tbl-”
     prefix when we laugh at you. 
    Why do you write SQL with assembly language flags? SQL programmers do not! Why did you use the term “master_” on a table name? This term is from tape files and network DB; it has nothing to do with RDBMS!! 
    Why do you think that “active” is an attribute? NO! It is a value of some particular attribute and needs a temporal range. 
    There is no generic “id” in RDBMS! Remember the Law of Identity from your first freshman logic class? Rows are not records, so you got that term wrong. We do not use mappings in RDBMS; we have REFERENCES. 
    CREATE TABLE Personnel
    (emp_id CHAR(10) NOT NULL PRIMARY KEY,
     emp_name VARCHAR(35) NOT NULL);
    CREATE TABLE Leave_Codes
    (leave_code CHAR(2) NOT NULL PRIMARY KEY,
     leave_code_description VARCHAR (20) NOT NULL);
    INSERT INTO Leave_Codes
    VALUES 
    ('PL', 'Paid Leave'),
    ('CL', 'Casual Leave'),
    ('SL', 'Sick Leave);
    I might have done this: 
    CREATE TABLE Employee_Leaves
    (emp_id CHAR(10) NOT NULL
     REFERENCES Personnel(emp_id)
     leave_start_date DATE NOT NULL,
     leave_end_date DATE NOT NULL,
    CHECK(leave_start_date < leave_end_date),
     leave_code CHAR(2) NOT NULL
      REFERENCES Leave_Codes (leave_code),
     PRIMARY KEY (??),
     >> why I made this table structure because our organization leave type are not fixed, so user can customize leave according their requirement, so I made allocation table with 1 to 31 column, so user can allocate leave type max 31. <<
    No, you did this out of ignorance. You do not understand RDBMS or SQL.  YHou do not know any of the basics. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Pivoting table results so YearIDs become columns with all other data underneath them

    The table above has all the data I need for my report, however, I need to pivot the table so that each YearID (based upon corresponding fkYear) is a separate column and the rest of the data in each row appears under the appropriate Year ID.  I'm trying
    to pivot the table but I'm stuck on exactly how to do it.
    RandyHJ1957

    Ok, here is what I have so far as a PIVOT using a CTE
    WITH ActiveAccountCodes AS
    SELECT BWfkYear, BWYearID, BWFund, BWMajorObject, BWObject, BWObjectDescr, BWAmount, BWDescr FROM @TmpProposedAccountCodes
    UNION
    SELECT BWfkYear, BWYearID, BWFund, BWMajorObject, BWObject, BWObjectDescr, BWAmount, BWDescr FROM @TmpCurrentAccountCodes
    UNION
    SELECT BWfkYear, BWYearID, BWFund, BWMajorObject, BWObject, BWObjectDescr, BWAmount, BWDescr FROM @TmpBudget1AccountCodes
    UNION
    SELECT BWfkYear, BWYearID, BWFund, BWMajorObject, BWObject, BWObjectDescr, BWAmount, BWDescr FROM @TmpBudget2AccountCodes
    UNION
    SELECT BWfkYear, BWYearID, BWFund, BWMajorObject, BWObject, BWObjectDescr, BWAmount, BWDescr FROM @TmpBudget3AccountCodes
    SELECT BWObject, BWObjectDescr, Proposed, Current, Actual1, Actual2, Actual3, BWDescr
    FROM ActiveAccountCodes
    PIVOT(SUM(BWAmount) FOR BWYearID IN ([SELECT BWYearID FROM @TmpProposedAccountCodes AS [Proposed]], [SELECT BWYearID FROM @TmpCurrentAccountCodes AS [Current]],
    [SELECT BWYearID FROM @TmpBudget1AccountCodes AS Actual1],
    [SELECT BWYearID FROM @TmpBudget2AccountCodes AS Actual2],
    [SELECT BWYearID FROM @TmpBudget3AccountCodes AS Actual3] )) AS PVT
    The error I am getting now is where I attempt to define the Proposed and Current column headings using a select statement to get the right YearID for the right year.  I get a red line under Proposed and Current in the main query above the PIVOT expression
    RandyHJ1957

  • I have read 118 files (from a directory) each with 2088 data and put them into a 2 D array with 2cols and 246384row, I want to have aeach file on a separate columns with 2088 rows

    I have read 118 files from a directory using the list.vi. Each file has 2 cols with 2088rows. Now I have the data in a 2 D array with 2cols and 246384rows (118files * 2088rows). However I want to put each file in the same array but each file in separate columns. then I would have 236 columns (2cols for each of the 118 files) by 2088 rows. thank you very much in advance.

    Hiya,
    here's a couple of .vi's that might help out. I've taken a minimum manipulation approach by using replace array subset, and I'm not bothering to strip out the 1D array before inserting it. Instead I flip the array of filenames, and from this fill in the end 2-D array from the right, overwriting the column that will eventually become the "X" data values (same for each file) and appear on the right.
    The second .vi is a sub.vi I posted elsewhere on the discussion group to get the number of lines in a file. If you're sure that you know the number of data points is always going to be 2088, then replace this sub vi with a constant to speed up the program. (by about 2 seconds!)
    I've also updated the .vi to work as a sub.vi if you wa
    nt it to, complete with error handling.
    Hope this helps.
    S.
    // it takes almost no time to rate an answer
    Attachments:
    read_files_updated.vi ‏81 KB
    Num_Lines_in_File.vi ‏62 KB

Maybe you are looking for