I want to transpose the data

I am having the data like this
1
1
b1
1
2
b2
1
3
b3
1
4
b4
2
1
a1
2
2
a2
2
3
a3
2
4
a4
3
1
c1
3
2
c2
3
3
c3
3
4
c4
I want to display like this
b1
b2
b3
b4
1
1
1
1
1
2
3
4
a1
a2
a3
a4
1
1
1
1
1
2
3
4
c1
c2
c3
c4
1
1
1
1
1
2
3
4
please help me here

I'm not sure that the way you want it be done is a classical transposing, which is literally rotation counterclockwise. The classical transposing can be done via PIVOT query but the result will be
b1 b2 b3 b4 a1 a2 a3 a4 c1 c2 c3 c4
1   1  1   1   2   2   2  2   3   3  3   3
1   2  3   4   1   2   3  4   1   2  3   4
So, there is no elegant way of doing your task. Especially, without VBA, I see the only way is a UNION ALL query. 
E.g. you have a table
t1
f1
f2
f3
1
1
b1
1
2
b2
1
3
b3
1
4
b4
2
1
a1
2
2
a2
2
3
a3
2
4
a4
3
1
c1
3
2
c2
3
3
c3
3
4
c4
<tfoot></tfoot>
You have 3 queries:
f_1
f1
1
2
3
4
1
1
1
1
1
2
2
2
2
2
3
3
3
3
3
<tfoot></tfoot>
TRANSFORM Max(t1.f1) AS [Max-f1]
SELECT t1.f1
FROM t1
GROUP BY t1.f1
PIVOT t1.f2;
f_2
f1
1
2
3
4
1
1
2
3
4
2
1
2
3
4
3
1
2
3
4
<tfoot></tfoot>
TRANSFORM Max(t1.f2) AS [Max-f2]
SELECT t1.f1
FROM t1
GROUP BY t1.f1
PIVOT t1.f2;
f_3
f1
1
2
3
4
1
b1
b2
b3
b4
2
a1
a2
a3
a4
3
c1
c2
c3
c4
<tfoot></tfoot>
TRANSFORM Max(t1.f3) AS [Max-f3]
SELECT t1.f1
FROM t1
GROUP BY t1.f1
PIVOT t1.f2;
And finally, the UNION ALL query:
piv
f1
1
2
3
4
1
b1
b2
b3
b4
1
1
2
3
4
1
1
1
1
1
2
a1
a2
a3
a4
2
1
2
3
4
2
2
2
2
2
3
c1
c2
c3
c4
3
1
2
3
4
3
3
3
3
3
<tfoot></tfoot>
select [f1], [1], [2], [3], [4] from f_1
UNION ALL
select [f1], [1], [2], [3], [4] from f_2
UNION ALL select [f1], [1], [2], [3], [4] from f_3
ORDER BY [f1], [4] DESC;
It's rather simple for your example with 3 letters and 4 numbers. As soon as you have, at least, 10 variations, it will be pure delirium.
Andrey V Artemyev | Saint-Petersburg, Russia

Similar Messages

  • How to transpose the data records (rows) to column(lists) using apd

    Hi,
      how to transpose the data records (rows) to column (lists) using apd  in sap bw.
    I do not want to use abap routine.only use the transpose rows to list  transformation .
    Pls provide the step by step procedure .
    thanks,
    Nimai

    Save youe file to transpose as a csv and in the header row of your file for the columns you want to transpose you need to put some soer of a tag before the column name (ie your colum header was for a period budget will be something lie 2011001:ZFIBDD)
    1. You will need to create a new apd process (rsanwb)
    2. Insert a "Read from Data File" data source object and map it file (,csv)
    3. insert a transpose object into your apd process (middle row 4th one over in the transformations section)
    4. under the definition tab in the transformation object select all the columns that are to be transposed into rows and move them to the transformed area, the grouping fields section should contain the rows that you want to now be columns
    5.under the transformation tab enter in the seperator you selected  under the Field Name/Infoobject area (ie. ZFIBDD)
    6. under the details tab  you need to enter in all the fields to be transformed and tner the transposition field (ie ZFIBDD)
    7. Then you can insert a set of transformations and a DSO and link the newly transposed fields into that.
    hope that helps

  • I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?

    I have a VI and an attched .txt data file. Now I want to read the data from the .txt file and display it as an array in the front panel. But the result is not right. Any help?
    Attachments:
    try2.txt ‏2 KB
    read_array.vi ‏21 KB

    The problem is in the delimiters in your text file. By default, Read From Spreadsheet File.vi expects a tab delimited file. You can specify a delimiter (like a space), but Read From Spreadsheet File.vi has a problem with repeated delimiters: if you specify a single space as a delimiter and Read From Spreadsheet File.vi finds two spaces back-to-back, it stops reading that line. Your file (as I got it from your earlier post) is delimited by 4 spaces.
    Here are some of your choices to fix your problem.
    1. Change the source file to a tab delimited file. Your VI will then run as is.
    2. Change the source file to be delimited by a single space (rather than 4), then wire a string constant containing one space to the delimiter input of Read From Spreadsheet File.vi.
    3. Wire a string constant containing 4 spaces to the delimiter input of Read From Spreadsheet File.vi. Then your text file will run as is.
    Depending on where your text file comes from (see more comments below), I'd vote for choice 1: a tab delimited text file. It's the most common text output of spreadsheet programs.
    Comments for choices 1 and 2: Where does the text file come from? Is it automatically generated or manually generated? Will it be generated multiple times or just once? If it's manually generated or generated just once, you can use any text editor to change 4 spaces to a tab or to a single space. Note: if you want to change it to a tab delimited file, you can't enter a tab directly into a box in the search & replace dialog of many programs like notepad, but you can do a cut and paste. Before you start your search and replace (just in the text window of the editor), press tab. A tab character will be entered. Press Shift-LeftArrow (not Backspace) to highlight the tab character. Press Ctrl-X to cut the tab character. Start your search and replace (Ctrl-H in notepad in Windows 2000). Click into the Find What box. Enter four spaces. Click into the Replace With box. Press Ctrl-V to paste the tab character. And another thing: older versions of notepad don't have search and replace. Use any editor or word processor that does.

  • HT1382 how can I restore my back up files from my laptop? i want to see the dates and time that I backed up  my files. is it posssible?

    how can I restore my back up files from my laptop? i want to see the dates and time that I backed up  my files. is it posssible?

    What backed up files?
    Available backups for an iOS device can be found in Edit > Preferences > Devices.

  • When insert my lexar USB flash drive I get the message that the disk was not readable by this computer.  It has worked previous to this and I do not want to lose the data by reformatting the drive.  How can I reformat this drive and not lose my data?

    When insert my lexar USB flash drive I get the message that the disk was not readable by this computer.  It has worked previous to this and I do not want to lose the data by reformatting the drive.  How can I reformat this drive and not lose my data?

    You can't reformat it and not wipe everything on it.
    Have you tried a different USB port?
    Only other option, back it up on a different computer.

  • Want to combine  the data different coloumn of table into single coloumn.

    HI All ,
    Requirement : I want to create an application which will display  diffrent coloumn(data) of a table into single coloumn  in web-dynpro abap .
    For ex:
    Table : employee
    coloumn : PERSON , PAYMENT , STATUS ,  SUBMISSION .
    RETURN  = PAYMENT + STATUS + SUBMISSION
    (return coloumn will contain the data of other coloumn )
    Thanks in advance .
    Rahul

    In your context, create a node 'Employee'. It should have the attributes person, payment, status, submission, return. Let return be of type string. I assume you have a ztable or some ddic structure employee, which does not have the return field.
    You code will be on these lines - change it to your requirements anyway. Place the code in a method depending on your requirement of when the data should be displayed.
    data: node_emp type ref to if_wd_context_node,
            itab_emp type table of employee,
            wa_emp  type employee,
            itab_node_emp type if_main=>elements_employee,
            wa_node_emp type if_main=>element_employee.
    node_emp = wd_context->get_child_node( name = 'EMPLOYEE' ).
    <i>* Get data from your API here into itab_emp *</i>
    loop at itab_emp into wa_emp.
      move-corresponding wa_emp to wa_node_emp.
      concatenate wa_emp-payment wa_emp-status wa_emp-submission separated by space into wa_node_emp-return.
      append wa_node_emp to itab_node_emp.
    endloop.
    node_emp->bind_elements( itab_node_emp ).
    Here, before the loop, you need to fetch the data into itab_emp using your APIs. Since you have said you want to display the data of multiple columns as is, I have just concatenated them.
    In your view layout, have a table and bind the data source to be the context node Employee.
    <b>The data types of itab_node_emp, wa_node_emp will differ based on your view name and node name. Use the code wizard to generate your code according to your design time.</b>
    Hope this helps.
    Regards,
    Nithya

  • I want to use the SQL Toolkit of NI and SQL Server as my databasis on a server. Do I need to install a client in each computer I want to handle the data into SQL tables or I need only a ODBC driver?

    I want to use the SQL Toolkit of NI and SQL Server as my databasis on a server. Do I need to install a client in each computer I want to handle the data into SQL tables or I need only a ODBC driver?

    You only need the ODBC driver on each computer. If you are distributing the SQL Toolkit app as an executable and do not install the whole toolkit on each computer, you'll need the SQL Toolkit support files. This is about a dozen files. You can get the list at http://digital.ni.com/public.nsf/websearch/b814be005f9da9258625658700550c75?OpenDocument.

  • I want to get the data of a table inside the Form but it is not passed

    I want to get the data of a table inside the Form but it is not passed to the form by tables parameters.
    How can I do this.
    Regards

    If there is a problem with defining it globaly, you can define a field symbol globably and point to it. For example.  It would probably be better to define your table globably.
    report zrich_0003 .
    field-symbols: <imarc> type marc_upl_tt.
    start-of-selection.
      perform get_data.
    *       FORM get_data                                                 *
    form get_data.
      data: imarc type table of marc with header line.
      select * from marc into table imarc up to 10 rows.
      assign imarc[] to <imarc>.
      perform write_data.
    endform.
    *       FORM write_data                                               *
    form write_data.
      data: xmarc type marc.
      loop at <imarc> into xmarc.
        write: / xmarc-matnr, xmarc-werks.
      endloop.
    endform.
    Regards,
    Rich Heilman

  • I want to load the data afterbeing data loaded

    after the data is being loaded into the cube,i want to load the data for the particular
    infoobject(e.g.0equipment),is it possible,how ?

    hi
    this is srinivas.thanx for giving me the helpful answer.
    bye..bye

  • Want to find the Data type of a variable at runtime ?

    Hi,
    I Want to find the Data type of a variable at runtime ?
    I think there is a function module... But i forgot ..... Can you please help me out.
    Points are rewarded immediately.

    hi,
    do this way
    REPORT ysantest LINE-SIZE 350.
    DATA : v_num TYPE n,
    v_type(2).
    DESCRIBE FIELD v_num TYPE v_type.
    WRITE : v_type.

  • I have data in Notepad,i want to upload the data to FB01 through the FM POS

    i have data in ITAB,i want to Transfer  the data to FB01 through the FM  POSTING_INTERFACE_DOCUMENT,How we pass the header data and Line item data.Can anyone suggest.

    Yes, first read the documentation of the following function modules
    - POSTING_INTERFACE_START
    - POSTING_INTERFACE_DOCUMENT
    - POSTING_INTERFACE_END
    important field is ftpost-stype with K for header fields and P for item fields
    You can easily find some samples via [sdn search|http://forums.sdn.sap.com/search.jspa?threadID=&q=POSTING_INTERFACE_DOCUMENT&objID=&dateRange=all&numResults=30&rankBy=10001] or google like [ABAP Custom Program into Batch Input Session.|http://www.sapfans.com/forums/viewtopic.php?f=13&t=25465#p75639]
    Regards,
    Raymond

  • My deceased brother's IPad was given to me but it is locked and passcode protected.  I do not want access to the data on it, but would like to be able to use it.  Can it be unlocked and reset to factory settings?  Thanks!

    My deceased brother's IPad was given to me but it is locked and passcode protected.  I do not want access to the data on it, but would like to be able to use it.  Can it be unlocked and reset to factory settings?  Thanks!

    You can try this: If you can't update or restore your iOS device
    If he had not turned on Find My iPad then it will work, if he had you will run into Activation Lock. If you do run into it you can take a copy of the will (or probate finding if he died without one) and/or a Letter Testamentary and ask if they can look up where he purchased it. If they can, and you have the other documents, they can reset it for you.

  • I have forgotten the password and do not have the old computer to sync with. I dont want to loose the data already on it?

    I have forgotten the password and do not have the old computer to sync with. I dont want to loose the data already on it?

    All you can do is restore from backup, You have to erase the iPod. That is a security feature
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: Back up and restore your iOS device with iCloud or iTunes
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        
    If problem what happens or does not happen and when in the instructions? When you successfully get the iPod in recovery mode and connect to computer iTunes should say it found an iPod in recovery mode.

  • I want to delimit the date of table v_t7int1 for new sap note uploading

    Hi
    i want to delimit the date of table v_t7int1 for new sap note uploading. wtihout delimit the date i can't create new note for the year 01.04.2009 to 31.12.9999
    Anjali

    Hi
    When i select the slab code sl10 and press delimit button system is asking the From Date and i want TO DATE  and i have to Delimit the date of  slab code SL10, SL11,SL12 and SR02 and then i have to create SL13,SL14 and SL15.
    Anjali

  • HT1364 I have a new PC and need to sync my iPhone5 to the new installation of iTunes. I don't want to lose the data on the phone! How do I do this? The PC is Win8 Pro.

    I have a new PC and need to sync my iPhone5 to the new installation of iTunes. I don't want to lose the data on the phone! How do I do this? The PC is Win8 Pro.

    If you have the old PC, transfer the library from it. If not, see Recover your iTunes library from your iPod or iOS device.
    tt2

Maybe you are looking for

  • Why is my iPad asking for a password after I updated it and now has me locked out

    AAfter doing the new update my iPad is asking for a password I do not have and has me locked out?why?

  • ITunes Library Messed Up

    Today I opened up my iTunes and a pop-up appeared saying that my library is damaged. I started out by trying some things like opening other libraries, but it didn't change. In the end I used Vistas System-Recovery (is that what it's called?) to set m

  • JRockit Management Console - Exception Count

    Hello, I'm using jrockit-j2sdk1.4.2_04. I download the JRA from: /wljrockit/docs142/JRA.zip. I started the Management Server with Tomcat 5.0. After starting the management console the exception count continuously increases one per second (approx). Is

  • HT1600 How to set up appletv on a new computer

    Hello, I just purchased a new Macbook Pro, and I have my appletv installed on my old apple computer. When I open my itunes on the new one the appletv icon or as a device is not appering. How do I set it up on my new laptop?

  • Oracle BI Scheduler service inactive

    Hi all, when I try to save an Ibot, I get the following error: Oracle BI Scheduler Error: [nQSError: 76012] The Scheduler client connection was closed. Impactos del error Códigos de error: GYFPI8RN I have the Scheduler Service running and the Present