Array to different columns

Hello,
In the attached VI, I am currently getting all the arrays to show up in the same columns. I am trying to show each pass in the attached VI to show as different colums in the string table.
Any help will be appreciated. 
Thanks,
hiNi.
Solved!
Go to Solution.
Attachments:
array to different columns.vi ‏21 KB

I would allocate a string array at the final size, then replace data as you go. Here's  quick rewrite (LabVIEW 8.5).
(I don't understand your use of the local variable, sequence structure, and while loops. The first two are not needed and the loops should be FOR loops because you know the number of iterations beforehand.
(Also note that you should work with strings for the final table. A numeric array will be padded with zeros for undersized rows or columns. An empty string for missing elements seems more appropriate.)
LabVIEW Champion . Do more with less code and in less time .
Attachments:
array to different columnsMOD.vi ‏16 KB

Similar Messages

  • Sum 2d arrays with different columns width

    hi,
    I have a 2d array that stores the number of rats in X number of houses.
    in each row, i have the number of rats per house (length) and the weight of each.
    So, if I have 3 houses, I would 3 rows (0,1,2).
    And, in house 1: I have 2 rats (0,1)
    then, rat1 weights 20, rat2: 15
    in house 2: I have 3 rats (0,1,2)
    rat1: 30, rat2: 25 rat3: 5
    in house 3: I have 1 rat (0)
    rat1: 50
    So, what I need to do is to calculate the total weight of rats per house and display:
    Total weight in House1: 35
    House2: 60
    House3: 50
    I dont know how to do the sum and display the sum for each house. Any hints/solutions?
    Message was edited by:
    gixty
    Message was edited by:
    gixty

    > yeah, but I am still looking for a way to sum every
    column per row.
    You've been given the same solution on two different forums. If you know how to loop through the houses, you know how to loop through the rats. The "rat loop" will be nested inside the "house loop". Each rat will be identified by two indices; the house index and the rat index. Just loop through the rats, adding each rat's weight to the total for that house.
    ~

  • Write arrays into a text file in different columns at different times

    Hi,
              I have a problem write data into a text file. I want to write 4 1D arrays into a text file. The problem is that I need to write it at different time and in different column (in other word, not only append the arrays).
    Do you have an idea to solve my problem?
    Thank you

    A file is long a linear string of data (text). In order ro insert columns, you need to rewrite the entire file, because colums are interlaced over the entire lenght of the file.
    So:
    read file into 2D array
    insert columns using array operations
    write resulting 2D array to file again.
    (Only if your colums are guaranteed to be fixed width AND you know the final number of colums, you could write the missing columns as spaces and then overwrite later. Still, it will be painful and inefficient, because column data are not adjacent in the file.)
    LabVIEW Champion . Do more with less code and in less time .

  • Datagrid itemrenderer & evaluation of different column

    Hey All,
    I've been playing with this for a while but can't get it right.  Basically, I have an itemrenderer that has an image and label, but I need to see what the value is of a different column before I know what image to use.  I have a feeling the reason why my intended logic won't work is becasue the data[] does not reporesent the whole data structure...but I could be wrong.
    This is what I have now:
    I have a grid that references this itemrenderer & the grid dataprovider is an array collection:
    Form
    <s:GridColumn dataField="employee"  headerText="Employee"
                     itemRenderer="com.mycompany.view.assets.renderers.EmployeeStatusColour"></s:GridColumn>
    Item Renderer
    <?xml version="1.0" encoding="utf-8"?>
    <s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
         ....>
      <fx:Script>
           <![CDATA[
              override public function prepare(hasBeenRecycled:Boolean):void {  
              //THIS WORKS BUT NEED TO ADD LOGIC
                   lblData.text = data[column.dataField];
                   statusImage.source = "com/mycompany/view/assets/images/dot_GREEN.png";
              //THIS IS WHAT I WANT INSTEAD - SYNTAX BELOW IS WRONG BUT YOU'LL GET THE IDEA
                   lblData.text = data[column.dataField];
                   if(data[column(3)]; = "MONDAY"{
                        statusImage.source = "com/mycompany/view/assets/images/dot_GREEN.png";
                   }else{
                        statusImage.source = "com/mycompany/view/assets/images/dot_BLUE.png";
            ]]>
      </fx:Script>
              <s:HGroup verticalAlign="middle" height="100%" gap="2">
              <s:Image id="statusImage"/>
              <s:Label id="lblData" paddingTop="5"/>
      </s:HGroup>
    </s:GridItemRenderer>
    Thanks in advance to anybody who can direct me to a solution.
    Flex

    Hi,
    I tried your suggestion but it didn't work.   Thanks though! 
    However, if you see the code below this works as I stated above.  data[column.dataField] returns the value of the referenced value. 
    override public function prepare(hasBeenRecycled:Boolean):void {
                                            lblData.text = data[column.dataField];
                                            statusImage.source = "com/mycompany/view/assets/images/dot_green.png";
    So I did a debug inside my item renderer and found that the data object had all the object values of the row from my grid, which is what I want.  I just don't know how to access them individually to do my comparison.  It's probably something really easy like
    If (data[column(4).dataField]=="MONDAY"){  
               statusImage.source = "com/mycompany/view/assets/images/dot_GREEN.png";
    I know I'm close just don't know the syntax.
    Thanks!

  • How to get multiple records in one row and different column

    Hi All,
    I am using oracle database 11g
    and i have a two tables table_1, table_2
    table_1 having columns
    emp_no
    first_name
    middle_name
    last_name
    email
    and table_2 having columns
    emp_no
    phone_type
    phone_number
    and having entires
    emp_no phone_type phone_number
    1001 MOB 9451421452
    1001 WEMG 235153654
    1001 EMG 652341536
    1002 MOB 9987526312
    1003 WEMG 5332621456
    1004 EMG 59612356
    Now i want the output of values with phone type as MOB or WEMG in a single row with different columns
    emp_no first_name middle_name last_name email mobile officeno
    1001 mark null k [email protected] 9451421452 235153654
    1002 john cena gary [email protected] 9987526312 null
    1003 dany null craig [email protected] null 5332621456
    1004 donald finn sian [email protected] null null
    can i have any inputs to achive this???
    Regards
    $sid

    Frank Kulash wrote:
    sonething like this:Frank, you missed aggregate function (pivot requires one). However main thing is it will cause ORA-01748:
    with table_1 as (
                     select 1001 emp_no,'mark' first_name,null middle_name,'k'last_name,'[email protected]' email from dual union all
                     select 1002,'john','cena','gary','[email protected]' from dual union all
                     select 1003,'dany',null,'craig','[email protected] null' from dual union all
                     select 1004,'donald','finn','sian','[email protected]' from dual
         table_2 as (
                     select 1001 emp_no,'MOB' phone_type,9451421452 phone_number from dual union all
                     select 1001,'WEMG',235153654 from dual union all
                     select 1001,'EMG',652341536 from dual union all
                     select 1002,'MOB',9987526312 from dual union all
                     select 1003,'WEMG',5332621456 from dual union all
                     select 1004,'EMG',59612356 from dual
    SELECT     *
    FROM     table_1      t1
    JOIN     table_2      t2  ON  t1.emp_no = t2.emp_no
    PIVOT     (    max(t2.phone_number)
         FOR  t2.phone_type  IN  ( 'MOB'   AS mob
                                 , 'WEMG'  AS wemg
            FOR  t2.phone_type  IN  ( 'MOB'   AS mob
    ERROR at line 19:
    ORA-01748: only simple column names allowed hereYou need to:
    with table_1 as (
                     select 1001 emp_no,'mark' first_name,null middle_name,'k' last_name,'[email protected]' email from dual union all
                     select 1002,'john','cena','gary','[email protected]' from dual union all
                     select 1003,'dany',null,'craig','[email protected] null' from dual union all
                     select 1004,'donald','finn','sian','[email protected]' from dual
         table_2 as (
                     select 1001 emp_no,'MOB' phone_type,9451421452 phone_number from dual union all
                     select 1001,'WEMG',235153654 from dual union all
                     select 1001,'EMG',652341536 from dual union all
                     select 1002,'MOB',9987526312 from dual union all
                     select 1003,'WEMG',5332621456 from dual union all
                     select 1004,'EMG',59612356 from dual
         table_3 as (
                     select  t1.emp_no,first_name,middle_name,last_name,email,
                             phone_type,phone_number
                       FROM     table_1      t1
                       LEFT JOIN     table_2      t2  ON  t1.emp_no = t2.emp_no
    SELECT     *
    FROM     table_3
    PIVOT     (    max(phone_number)
         FOR  phone_type  IN  ( 'MOB'   AS mob
                                 , 'WEMG'  AS wemg
        EMP_NO FIRST_ MIDD LAST_ EMAIL                     MOB       WEMG
          1004 donald finn sian  [email protected]
          1003 dany        craig [email protected] null            5332621456
          1001 mark        k     [email protected]      9451421452  235153654
          1002 john   cena gary  [email protected]    9987526312
    SQL>SY.

  • Not able to display data in different columns using Unicode encoding

    Hi,
    Iam using Unicode encoding in my Java appln to support Japanese characters while downloading CSV report. But using the Unicode encoding displays all data in the first column of Excel sheet.
    Please let me know how to display data in different columns using Unicode encoding in Excel sheet.

    Hi Venkat,
    After extracting data into DSO check the request whether active or not.
    Check data in DSO in contents.
    If is there any restrictions on info providers in Queries.
    Let us know status clearly.......
    Reg
    Pra

  • IR - if count (primary key) cannot change to count different column

    Apex 4.1.1.00.23 Windows 7 IE8 / Firefox 16
    If I add a Group By and Count to an Interactive report and choose the primary key column as the one to Count, run the report and then edit the Group By to count a different column, the result set does not change, and if I edit the Group By again it shows that the Counted column has reverted back to the primary key column.
    If I initially choose a different column I can change it and rerun the report successfully, but once I choose the primary key column it cannot be changed. This seems to happen on all applications and all browsers. Is it a bug in Apex?
    Thanks,
    Nick.

    I've tried this in 4.1.0.00.32: works normally. In 4.1.1.00.23 however i'm getting the weird behaviour: you can count on any column, but the moment you count the same column as the one grouped on you can not change the column back to another one anymore. Something which works fine in 4.1.0.00.32.

  • BO xi 3.1 u2013 schedule a template for multiple reports with different column

    Hi,
    I need to migrate the existing reports from SQL Server Reporting Services to BO, and the column order in the report is very important to the clients since clients have existing code to ingest these reports into their database. Now I want to schedule a single template with different parameters for all reports in BO, or create a single template with lot of parameters for all reports. My question is how I might use one template to create multiple reports with different column orders in the reports?
    For example, client A has the following column order in their report: firstName, LastName, DateBirth, SSN. Client B has the following column order in their report: SSN, DateBirth, LastName, FirstName. Can I use one template to create these multiple reports?
    Thanks!

    Hi,
    The only approach I can think of is to create a template report which uses variables
    For each column you would need to variable
    v_columnAName and v_columnAValue
    v_columnAName would have a if statement in it
    =if([client]="clientA" or [client]="clientC";NameOf([firstName]);if([client]="clientB";NameOf([SSN]);NameOf([lastName]));
    v_columnA would have a if statement in it
    =if([client]="clientA" or [client]="clientC";[firstName];if([client]="clientB";[SSN],[lastName]));
    This would only work when you had a small set of clients.
    This might be more managable if it was done in the universe
    Regards
    Alan

  • Different number of rows for different columns in JTable

    hi
    I need to create a JTable with different number of rows for different columns...
    Also the rowheight should be different in each column...
    say there is a JTable with 2 columns... Col1 having 5 rows and column 2 having 2 rows...
    The rowHeight in Col2 should be an integer multiple of Rowheight in Col1
    how do I do this ??
    can anybody send me some sample code ?????
    thanx in advance

    How about nesting JTables with 1 row and many columns in a JTable with 1 column and many rows.
    Or you could leave the extra columns null/blank.
    You could use a GridBagLayout and put a panel in each group of cells and not use JTable at all.
    It would help if you were more specific about how you wanted it to appear and behave.

  • Adding up entries of 2 different columns of a table in a single view column

    Hi All,
             I have a requirement wherein I have to add up the entries of 2 different columns of 2 different database tables and show it in one column of a View.
    Eg. Table A has column A and Table B has column B. I create a view C with column C.
    Now Col C = Col A + Col B
    Can anyone please let me know how this view can be created?
    Thanks,
    Momdipa

    Hi Momdipa,
    ABAP Table View does not support dynamic arithmetic operations. So, you can't achieve this business logic in the view. There are no operators in the view which can help you to do this.
    If you need this functionality, you need to create a ABAP Report to calculate the sum on the execution of the Report. And then you can update the View based on your own business logic.
    Hope this helps.
    Thanks,
    Samantak.

  • Amount from 2 different columns. import format?

    Hi all,
    Im trying to import amounts from 2 different columns. If accounts are "123" or "234" or...etc
    Then pull from column
    else use column 9
    can this be done in one import script? I want to know if I can assign import format amount to column 5 but only get the accounts asked for. else use column 9.
    thanks

    I made something like this, and assigned it to an amount column with all the amounts. Does it make sense?
    Function This_Code (strField, strRecord)
    Dim Account
    Dim Ammount
    'Field instead of strRecord
    account = DW.Utilities.fParseString(strField, 12, 5, ",")
    Amount = DW.Utilities.fParseString(strField, 12, 11, ",")
    If Account = "123" or Account = "456" Then
    Amount = This_Code
    End If
    Edited by: tyson33 on Jun 28, 2012 10:11 AM

  • How To UPLOAD a DATA (.DAT) fiel from PC to internal table and then split it into the data different columns

    Hi all,
    I am new to ABAP Development. I need to upload a .DAT file (the file doesn#t have any proper structure-- Please find the .DAT file in the attachment). After uploading the DATA (.DAT) fiel I need to split in into different columns. Refering the attached .DAT fiel the fields in bracets like:
    [Arbeitstag],  [Pecunia], [Mita], [Kunde], [Auftrag] and  [Position] are different fields that need to be arranged in columns in an internal table. this .DAT fiel which I want to upload and then SPLIT it into various fields will will treated as MASTER DATA table for further programming. The program that I had written is as below. Also please refer the attached .DAT table.
    Please if any one could help me. i searched a lot in different forums but couldn't find me  a solution. Also note that the attached fiel is in text (.txt) format here but in real situation the same fiel is in DATA (.DAT) format.
    *& Report  ZDEMO_ZEITERFASSUNG9
    REPORT  ZDEMO_ZEITERFASSUNG9.
    Types: Begin of ttab,
            Rec(1000) type c,
           End of ttab.
    DATA: itab  type table of ttab.
    DATA: wa_tab type ttab.
    DATA: file_str type string.
    Parameters: p_file type localfile.
    At selection-screen on value-request for p_file.
                                           CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
                                            EXPORTING
    *                                          PROGRAM_NAME        = SYST-REPID
    *                                          DYNPRO_NUMBER       = SYST-DYNNR
    *                                          FIELD_NAME          = ' '
                                               STATIC              = 'X'
    *                                          MASK                = ' '
                                             CHANGING
                                               file_name           = p_file.
    *                                        EXCEPTIONS
    *                                          MASK_TOO_LONG       = 1
    *                                          OTHERS              = 2
    Start-of-Selection.
      file_str = P_file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = '\\10.10.1.92\Volume_1\_projekte\Zeiterfassung-SAP\BUP_ZEIT.DAT'   " This the file  source address
          FILETYPE                      = 'DAT'
          HAS_FIELD_SEPARATOR           = ';'
    *     HEADER_LENGTH                 = 0
    *     READ_BY_LINE                  = 'X'
    *     DAT_MODE                      = ' '
    *     CODEPAGE                      = ' '
    *     IGNORE_CERR                   = ABAP_TRUE
    *     REPLACEMENT                   = '#'
    *     CHECK_BOM                     = ' '
    *     VIRUS_SCAN_PROFILE            =
    *     NO_AUTH_CHECK                 = ' '
    *   IMPORTING
    *     FILELENGTH                    =
    *     HEADER                        =
        tables
          data_tab                      = itab
       EXCEPTIONS
         FILE_OPEN_ERROR               = 1
         FILE_READ_ERROR               = 2
         NO_BATCH                      = 3
         GUI_REFUSE_FILETRANSFER       = 4
         INVALID_TYPE                  = 5
         NO_AUTHORITY                  = 6
         UNKNOWN_ERROR                 = 7
         BAD_DATA_FORMAT               = 8
         HEADER_NOT_ALLOWED            = 9
         SEPARATOR_NOT_ALLOWED         = 10
         HEADER_TOO_LONG               = 11
         UNKNOWN_DP_ERROR              = 12
         ACCESS_DENIED                 = 13
         DP_OUT_OF_MEMORY              = 14
         DISK_FULL                     = 15
         DP_TIMEOUT                    = 16
         OTHERS                        = 17
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP at itab into wa_tab.
            WRITE: / wa_tab.
      ENDLOOP.
    I will be grateful to all you experts for ur inputs
    regards
    Chandan Singh

    For every Auftrag, there are multiple Position entries.
    Rest of the blocks don't seems to have any relation.
    So you can check this code to see how internal table lt_str is built whose first 3 fields have data contained in Auftrag, and next 3 fields have Position data. The structure is flat, assuming that every Position record is related to preceding Auftrag.
    Try out this snippet.
    DATA lt_data TYPE TABLE OF string.
    DATA lv_data TYPE string.
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename = 'C:\temp\test.txt'
      CHANGING
        data_tab = lt_data
      EXCEPTIONS
        OTHERS   = 19.
    CHECK sy-subrc EQ 0.
    TYPES:
    BEGIN OF ty_str,
      a1 TYPE string,
      a2 TYPE string,
      a3 TYPE string,
      p1 TYPE string,
      p2 TYPE string,
      p3 TYPE string,
    END OF ty_str.
    DATA: lt_str TYPE TABLE OF ty_str,
          ls_str TYPE ty_str,
          lv_block TYPE string,
          lv_flag TYPE boolean.
    LOOP AT lt_data INTO lv_data.
      CASE lv_data.
        WHEN '[Version]' OR '[StdSatz]' OR '[Arbeitstag]' OR '[Pecunia]'
             OR '[Mita]' OR '[Kunde]' OR '[Auftrag]' OR '[Position]'.
          lv_block = lv_data.
          lv_flag = abap_false.
        WHEN OTHERS.
          lv_flag = abap_true.
      ENDCASE.
      CHECK lv_flag EQ abap_true.
      CASE lv_block.
        WHEN '[Auftrag]'.
          SPLIT lv_data AT ';' INTO ls_str-a1 ls_str-a2 ls_str-a3.
        WHEN '[Position]'.
          SPLIT lv_data AT ';' INTO ls_str-p1 ls_str-p2 ls_str-p3.
          APPEND ls_str TO lt_str.
      ENDCASE.
    ENDLOOP.

  • Use different column Name in Analytic View depending by logon session language

    Hi everybody.
    Is it possible to have different column names for ONE single Analytic View column depending by the Client session language?
    For instance:
    - we have one (only one)  column name let's say that is 'fatturato' (for an Italian Client session) and 'invoiced' (for an English Client session) etc.. etc..
    in other word the 'column name' changes depending by the language but the column is only 1 (one).
    Is it possible to manage this and how? In SAP Hana Studio?
    Is it possible to store in some way the different names of that column and relate them to the column itself?
    Thank you in advance
    Best regards.
    Sergio

    Hi Sumeet.
    We already did your suggestion...
    But after the action:
    " tab--> Migrate--> Add---> OK"
    what do you have to do to have a multi-language column naming?
    Let's say we have a column name = 'product' (in English).
    We'd like to have for the same column also the following name:
    - 'prodotto'  ->  for Italian
    - 'produit'  -> for French
    - 'produkt' -> for German
    .. and so on
    depending  by the Client session language (and this has to be done automatically of course).
    How this can be achieved?
    Thank you
    Sergio

  • Filename seperately & Putting data from Hash Map to two different columns

    The following code produces the output as :
    $ java getNamefile
    File Name : reaper.txt
    File Name : Testing
    Is it possible to just get the file name "reaper" from it instead of reaper.txt
    import java.io.*;
    class getNamefile
         public static void main(String[] args)
              File f1 = new File("C:/javamyprograms/reaper.txt");
              File f2 = new File("C:/javamyprograms/Testing/");
              System.out.println("File Name : " + f1.getName());
              System.out.println("File Name : " + f2.getName());
    }Secondly I am trying to put the values from a HashMap into ".xls"
    PrintWriter out = new PrintWriter (new FileWriter("Unique_words_count" + file) + ".xls");
    and out.write(key + " " + hm.get(key));
    This put the values in the same columns. I want the results to be two different columns like
    column1 column2
    key1 value1
    key2 value2
    Please do advise. Thanks in advance.

    Is it possible to just get the file name "reaper"from it instead of reaper.txtActually, I ran a test, and
         System.out.println(  "file name portion == " + ( f.getName().split( "\\." ) )[ 0 ] );works also:
    This has the same effect as:
         String fileName = f.getName();
         String splitFileName[] = fileName.split( "\\." );
         System.out.println(  "file name portion == " + splitFileName[ 0 ] );Now that I think about it, the second form is more easily understood. There is really no reason to do it the first way. Just interesting to note that you can.

  • How to sum different column in the same table

    Hi everyone
    I would like to know how can I make the sum of different column in the same table using apex
    exple:
    TR_PROJ_BIL_TRIM.ENTPIDFISC as ENTPIDFISC,
        TR_PROJ_BIL_TRIM.EXEANNEE as EXEANNEE,
        TR_PROJ_BIL_TRIM.PROJBILTRIMT1PREV as PROJBILTRIMT1PREV,
        TR_PROJ_BIL_TRIM.PROJBILTRIMT2PREV as PROJBILTRIMT2PREV,
        trunc( TR_PROJ_BIL_TRIM.PROJBILTRIMT1PREV)+(TR_PROJ_BIL_TRIM.PROJBILTRIMT2PREV)
    from TR_PROJ_BIL_TRIM TR_PROJ_BIL_TRIM
    group by TR_PROJ_BIL_TRIM.ENTPIDFISC,TR_PROJ_BIL_TRIM.EXEANNEE
    but while trying to run this script i get this error message:"ORA-00979: not a GROUP BY expression"
    thanks for reading me and I hope to hear from you soon

    Hi,
    Your question do not have anything do with APEX.
    It is pure SQL question and you will get better answer this kind questions from SQL and PL/SQL forum
    You need have GROUP BY when you use aggregate functions like SUM.
    I assume you like just add two columns.
    Try
    SELECT ENTPIDFISC
        ,EXEANNEE
        ,PROJBILTRIMT1PREV
        ,PROJBILTRIMT2PREV
        ,trunc(PROJBILTRIMT1PREV) + (PROJBILTRIMT2PREV)
    FROM TR_PROJ_BIL_TRIM
    Regards,
    Jari

Maybe you are looking for

  • Error configuring Scheduler for BI Publisher

    I'm using Oracle BI Suite EE 10.1.3.2 and I'm having problems to configure the Scheduler for BI Publisher. I've configured the connection to the database and Installed the schema successfully, but when I click on the Schedules tab I get the error: Sc

  • Just upgraded mysql, now can't connect, why?

    I had mysql 5.0.15 installed on my Mac Mini. I downloaded the standard 5.0.22 version from www.mysql.com and installed it. The mysql Preference Pane allows me to start it. I did and it says that it is "running". But now my php pages and CocoaMysql ca

  • Gnome 3 language changed after update

    After a recent update, it seems that the language of gnome 3 defaults to Arabic. Every time I login there is a pop-up that asks me to "Update standard folders to current language?" (The folder listed is ~/Music) Also, Google chrome defaults to Arabic

  • Query to retrieve foreign key constraints

    Hi, The JDBC DatabaseMetaData class provides the functions getImportedKeys and getExportedKeys to describe the foreign key relationships between tables, but is very slow. Is it possible to get this data directly from the TimesTen system tables? Ben

  • Help Center Error

    Adobe Help Center Error Message. It claims I don't have the right product installed. PSE 5 IS installed and it works OK - just not the help system.