Need to create colums from rows of data

How can I create this to update a table or in an export? I have a table with multiple duplicate records that have a single column with different values.
I want to change these record
EMPI
Date_of_Service
E-Code
964
09/07/2014
E000.8
964
09/07/2014
E013.0
964
09/07/2014
E849.0
964
09/07/2014
E917.4
2329
12/06/2014
E814.7
2329
12/06/2014
E849.5
To this
EMPI
Date_of_Service
E-Code
E-Code2
E-Code3
E-Code4
E-Code5
Column1
964
09/07/2014
E000.8
E013.0
E849.0
E917.4
2329
12/06/2014
E814.7
E849.5
3186
06/18/2014
E928.9
23942
02/01/2014
E849.0
E950.0
23942
02/01/2014
E950.0

I didn't look at your desired output close enough.   You need a query before the crosstab.  se your table name instead of 'Table_Y.'
    E_Code_Numbering --
SELECT Table_Y.EMPI, Table_Y.[E-Code], Table_Y.Date_of_Service, Count(Table_Y.EMPI) AS CountOfEMPI
FROM Table_Y INNER JOIN Table_Y AS Table_YY ON Table_Y.EMPI = Table_YY.EMPI
WHERE (((Table_YY.EMPI)=[Table_Y].[EMPI]) AND ((Table_YY.Date_of_Service)=[Table_Y].[Date_of_Service]) AND ((Table_YY.[E-Code])<=[Table_Y].[E-Code]))
GROUP BY Table_Y.EMPI, Table_Y.[E-Code], Table_Y.Date_of_Service
ORDER BY Table_Y.EMPI, Table_Y.Date_of_Service;
TRANSFORM First(E_Code_Numbering.[E-Code]) AS [FirstOfE-Code]
SELECT E_Code_Numbering.[EMPI], E_Code_Numbering.[Date_of_Service]
FROM E_Code_Numbering
GROUP BY E_Code_Numbering.[EMPI], E_Code_Numbering.[Date_of_Service]
PIVOT "E-Code " & [CountOfEMPI];
Build a little, test a little

Similar Messages

  • Need to create a new row in table with same data as Primary key, but new PK

    Hello Gurus ,
    I have a table with one column as primary key, I need to create a new row in the table, but with same data as in one of the rows, but with different primary key, in short a duplicate row with diferent primary key ..
    Any ideas of how it can be done without much complication?
    Thanks in advance for your reply.
    Reards,
    Swapneel Kale

    user9970447 wrote:
    Hello Gurus ,
    I have a table with one column as primary key, I need to create a new row in the table, but with same data as in one of the rows, but with different primary key, in short a duplicate row with diferent primary key ..
    Any ideas of how it can be done without much complication?
    Thanks in advance for your reply.
    Reards,
    Swapneel Kalesomething like
    insert into mytable values ('literal for new pk',
                                           select non-pk-1,
                                                    non-pk-2,
                                                    non-pk-n
                                           from mytable
                                           where pk-col = 'literal for existing pk')

  • XI/PI: need to create configuration from backend service interface to file

    Hi All,
    I need to create configuration in which i have to map my backend service interface to file document.
    For example i have interface CreateOrderInformation_Out which is coming from abckend and i want to store those details in a file on external/desktop via XI/PI.
    Can someone guide me with detailed steps involved in this?
    Which communication channel to use?How to create that channel?
    Thanks in advance,
    Regards,
    Ujwal

    Hi,
    your scenario will look like this:
    ECC->XI->File
    From ECC to XI: Use ABAP proxy (no communication channel required)
    From XI to File: Use file adapter (receiver communication channel required).
    For creating proxy: goto transaction sproxy and create proxy of CreateOrderInformation_Out.
    Call this proxy in your code to transfer data to XI/PI.e
    You need to define following objects in PI:
    Inbound receiver interface
    Message Type (includes datatype)
    Refer to SDN and SAP help for step by step tutorials.
    Regards,
    Gourav

  • BAPI for Create PO from Sales Order Data and POST GR from PO created

    Dear,
             Can u help me how to create BAPI for Purchase Order creation from sales order Data
              what the bapi to Post GR from the PO created.
    Regards,
    Manoj

    Hello Manoj what you have to do to create PO from PR is that
    1) Use   BAPISDORDER_GETDETAILEDLIST (pass sales order number in sales_document table) and then get PR (Purchase requisition number from this BAPI.
    2) Use  BAPI_REQUISITION_GETDETAIL to get PR items
    3) Use BAPI_PO_CREATE1 to craete PO from PR then.
    to create goods movement you can use
    BAPI_GOODSMVT_CREATE
    REWARDS IF USEFUL.

  • No. of Connections needed for creating universes from SAP BEx Queries

    Hello,
    I have 8 SAP BEx queries, my task to create to universe for all of these queries. I have created a datasource connection, my question here is can I use the same connection for all the queries by changing datasource connection and selecting the new query or is it suggestable to create 8 datasource connections in universe designer??
    please let me know if you need any more info.
    Your reply is highly appreciated.
    Thanks,
    Naresh

    HI,
    You need to create 8 connection for 8 BW queries.There is  one to one mapping in the universe.If you change the existing connection source then it will not work for earlier query.
    Other thing you can check like you have 8 queries then instead of creating 8 universe if possible then merge some queries in the single bw query and then create universe.
    Thanks,
    Amit

  • Is this the product I need to create PDF from a form online?

    Hello,
    I need to develop an application where the user fills out an online form and a pdf is automatically created and emailed to them, a copy is also archived. Am I looking in the corect place by exploring LiveCycle PDF Generator or am I looking for something else? I am currently using php and MySQL but from the looks of it may be necesary to use XML. This is very new to me so any direction would be much appreciated.
    Thanks
    Nils Satterstrom

    I am in the same boat as Nils. Has anyone made any discoveries on this? I have a call in to a "specialist" at Adobe, but it will be 3-5 days before someone gets back to me. I want to collect the data using PHP/MySQL and then populate a PDF template of some sort to create a print-ready PDF that I can send to my printer.
    An example of how we plan on using this is with business cards. We're going to create a business card template PDF with form fields for Name, Title, Phone, Email, etc. and then have the user enter in their information and then create a print-ready PDF we could send to the printer to get printed. I am unclear on which Adobe product would work for this. The pre-sales team at Adobe said we might want to look into InDesign server and LiveCycle. I guess the starting price tag for either of those is $10,000.
    Any insight would be great. Thanks!

  • Is newfs needed when creating mirror from existing ufs partition

    I have the root drive of my sparc solaris 10 server mirrored with SVM. In the same machine I have another single partition disk that was mounted /dev/dsk/ct0d0s6 to /home1, and I wanted to mirror it to another disk. This happened without problem.
    While the resync was happening I realized that I did not do a newfs on the target mirror disk (/dev/dsk/c1t2d0s6 partition before doing the metattach. I did not have a problem with reboots or anything after the resync was done. Will the mirror create a UFS partition on the target disk? If the source /home1 disk failed, would I be able to mount the target disk as a regular /dev/dsk partition? Or if I wanted to metaoffline the target half of the /home1 mirror to do a backup, would it recognize it as be a UFS partition?
    I'm thinking I should metadetach the mirror, do a newfs on the target S6 partition and then metattach again.
    Any ideas would be appreciated.

    Your getting a little confused about the difference between a partition/slice and a filesystem.
    Partitioning is the act of breaking the disk up into "slices". You have been referring to c0t0d0s6 which is a slice.
    Partitioning is done with the format program.
    The filesystem is the data that goes onto the slice. This is what newfs does. It creates a filesystem on a slice. So all its doing is writing a particular pattern of data onto a chunk of disk.
    So mirroring filesystems doesnt require a newfs. Since the correct pattern of data already exists. You just need to copy it onto the new slice.
    But the mirroring doesnt do partitioning ie create the slice. You have to do that with format. But it does copy the filesystem.
    So assuming you created a new slice of the correct size.
    You should be able to mirror the existing slice to the new slice. Then mount the virtual device representing the mirror.
    You do have to always use the mirror through the virtual /dev/md device, not the raw slices.
    The raw slices making up the mirror are perfectly ordinary UFS partitions. So yes they will be recognised.
    But if you modify one directly instead of through the virtual device, you changes won't be mirrored to the other.
    But yes, if a disk fails. You can use the other slice directly if necessary. But normally you would just keep using the metadevice.
    And if you metaoffline a disk. You could then back it up.
    But backups are normally more conveniently done with fssnap. That way you don't have to split mirrors and join them again.

  • Will OBIEE Support creating reports from 2 different data sources

    Hello Guys
    I am new to BI . Can anybody let me know how to create a report using 2 different data sources .
    Ex: Suppose we have 10G and SQL server , can we import tables to rpd and join 1 fact & dimension from 10G and 1 Fact from SQL server to the 10G tables . If so ,
    1) Will the repository be consistent ?
    2) Is it a best practice to do this kind of modeling ?
    3) Will it affect the performance of the reports ?
    Your advice is highly appreciated .

    Hi,
    Dont try to do this at the BI server layer. Oracle has special abilities to do this thing. So use the power of oracle to import the tables from the sql server to oracle and in the bi server just create one data source.
    you can browse for *'DBLINK'* in oracle.
    Regards,
    Karthick

  • Create logfile from three vis - data is sometimes missing

    Hello,
    i have three measurement-vis running parallel in a loop
    The three results are continuously saved in  global-array and also in a text-file.
    The global-arrays has always all data but in the text-file is some data missing.
    I think this is because the file is locked from one vi while the other vi wants to write his data.
    What can i do here?
    Something like writing data in a queue and another vi reads the queue and writes the file?
    Or is there something like a "check if file is in use"-property? Then i could loop until unused before executing write?
    Thanks
    Solved!
    Go to Solution.

    Sempaphores can slow down the measuring, as the loops will have to wait to get the semaphores, go with the queue.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Need help creating script to clear data with user inputs

    Hi experts.
    I need to create a script to clear data in a DEV system from a particular junction.
    Basically, I need the user to enter a CATEGORY, ENTITY and TIME which will then be used to delete all data in a particular table which meetes those criteria.
    I tried to write it in SSIS, but can't get a user input box.
    Also, Stored Procedures are not designed to open input boxes for these entries.
    Therefore, is there a way to do this in BPC script logic?
    I believe that I might be able to write either a Stored Procedure or DTSX package and then pass data from BPC Run Package?
    If this is correct, how would I go about it?
    Also, would it be possible to read the DISTINCT entries for Category, Time and Entity and present as a dropdown list?  (It doesn't matter too much if not, a manual entry would have to do).
    I will admit that I have no experience of script logc, so any docments and/or pointers would be appreciated.
    Thanks

    Thank Karthik, but I can't use the clear for this job.
    Specifically, I need this to delete from the LCK tables whenever data gets stuck, so if anyone can tell me the format to use, I'd be extremely grateful
    (And I appreciate that this is not recommended, but it's a DEV system and we need a way to clear these locks quickly when they occur)
    Edited by: Pie Eyed on Oct 1, 2011 2:54 PM

  • Can we create a new row in a table using a down arrow

    Hi,
    I am using jdeveloper 11.1.1.6.
    For one of my project, I have a requirement where i need to create a new row in table using a down arrow. My client does not want to use mouse clicks. They want to use keyboard as much as possible.(Fast data entry).
    Is it possible to create a new row using down arrow. Any pointers will be helpful!
    Thanks,
    Umesh

    you can try this thing
    steps
    - capture downkey event - may b this help http://www.qualitycodes.com/tip/1/capturing-keys-with-javascript.html
    if not google more
    -then call from javascript call java method - https://blogs.oracle.com/jdevotnharvest/entry/how-to_call_server_side_java_from_javascript
    -then create new row of table VO .....

  • How to create a report with survey data

    Hi All,
    I need to create a report with survey data in below format. Can anyone help me how to display the summary in this format.
    Swapna

    Hi Swapna,
    According to your description, you want to create a report with survey data and display the summary.
    Reporting Services is used for rendering the report with data retrieved from datasource. In Reporting Services, we can retrieve data from the datasource then design a report, after the report processed, data is fixed on the report. So it’s not supported
    to have the end users selection and do summary. For your requirement, it’s can’t be achieved currently.
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Retrieve 3 rows of data and put each row in different position on screen

    I need to retrieve 3 consecutive rows of data (easy) and need to put each row's data in an entirely different location on the home page
    for example,
    row 1 needs to go up in the top left content box
    row 2 needs to go in the large content area in the middle of the page
    row 3 needs to be put down in the footer of the page
    what's the most efficient way to do this ?

    Ok, I've tried to research this a bit more, but I'm no further forward
    So if I have a query...
    <cfquery name="getData" datasource="foo">
      SELECT *
      FROM 00_pricelist
    </cfquery>
    <cfoutput query="GetData" startrow=1 maxrows=3 >
         <!--- surrounding table 1 --->
         #getData.uneak_code[1]#<br />
         <!--- surrounding table 2 --->
         #getData.uneak_code[2]#<br />
         <!--- surrounding table 3 --->
         #getData.uneak_code[3]#<br />
    </cfoutput>
    can you tell me what I'm doing wrong ?

  • Split rows by date.

    Hi All,
    I need help to split a row by date.
    For example.
    in the two columns Effictive_start_date and effictive_end_date for the table per_all_people_f
    is '01-01-2006' and '01-30-2010' respictivly for one row.
    Then the resulting query should return 5 rows one for each year. and effective_end_date should be the last date of the year for each row
    Thanks in advance.
    Thanks\Kiran S

    Something like this:
    with sample_data as (select '12002' id, to_date('01-JAN-2006', 'DD-MON-YYYY') start_date, to_date('12-DEC-2010', 'DD-MON-YYYY') end_date from dual union all
                         select '12003' id, to_date('01-NOV-2006', 'DD-MON-YYYY') start_date, to_date('21-DEC-2009', 'DD-MON-YYYY') end_date from dual union all
                         select '12004' id, to_date('13-FEB-2007', 'DD-MON-YYYY') start_date, to_date('13-NOV-2008', 'DD-MON-YYYY') end_date from dual union all
                         select '12005' id, to_date('12-AUG-2008', 'DD-MON-YYYY') start_date, to_date('21-OCT-2008', 'DD-MON-YYYY') end_date from dual),
    -- end of mimicking your sample_data
         dummy_years as (select add_months(start_dt, (level - 1)*12) start_dt, add_months(start_dt, level*12) end_dt
                         from   (select trunc(min(start_date), 'yyyy') start_dt,
                                        add_months(trunc(max(end_date), 'yyyy'), 12) end_dt
                                 from   sample_data)
                         connect by level < months_between(end_dt, start_dt)/12 + 1)
    -- this bit generates a list of years based on the gap between the lowest and highest years present in the sample_data subquery
    select sd.id,
           greatest(sd.start_date, dy.start_dt) new_start_date,
           least(sd.end_date, dy.end_dt-1) new_end_date
    from   sample_data sd,
           dummy_years dy
    where  trunc(sd.start_date, 'yyyy') <= dy.start_dt
    and    add_months(trunc(sd.end_date, 'yyyy'), 12) >= dy.end_dt
    order by sd.id,
             new_start_date,
             new_end_date;
    ID    NEW_START_DATE NEW_END_DATE
    12002 01/JAN/06      31/DEC/06  
    12002 01/JAN/07      31/DEC/07  
    12002 01/JAN/08      31/DEC/08  
    12002 01/JAN/09      31/DEC/09  
    12002 01/JAN/10      12/DEC/10  
    12003 01/NOV/06      31/DEC/06  
    12003 01/JAN/07      31/DEC/07  
    12003 01/JAN/08      31/DEC/08  
    12003 01/JAN/09      21/DEC/09  
    12004 13/FEB/07      31/DEC/07  
    12004 01/JAN/08      13/NOV/08  
    12005 12/AUG/08      21/OCT/08  

  • Sum values in last row for date format "hh24:mi"

    Hi,
    I have a big problem creating a sum row with date data.
    I created a sql view where the result looks like that:
    SELECT category_name,
    user_name,
    b_mmyyyy,
    b_1, ..., b_31
    FROM view_category_user_booking
    category_name, user_name, b_1, ..., b_31
    category1, user1, 122008, 01:00, ..., 03:30
    category2, user1, 122008, 02:00, ..., 01:00
    category3, user1, 122008, 00:00, ..., 00:15My goal is to integrate a sum row at the end for the columns b_1 ... b_31
    category_name, user_name, b_1, ..., b_31
    category1, user1, 122008, 01:00, ..., 03:30
    category2, user1, 122008, 02:00, ..., 01:00
    category3, user1, 122008, 00:00, ..., 00:15
    Sum, user1, 122008, 03:00, ..., 04:45I tried it like that:
    select decode(grouping(category_name),1,'Summe',category_name),
    sum(to_number(replace(b_1,':',','))) as b_1,
    sum(to_number(replace(b_31,':',','))) as b_31
    from category_user_booking
    where user_name = 'user1'
    and b_mmyyyy = '122008'
    group by rollup(category_name)But the result isn't really successful
    category_name, b_1, b_31
    category1, 1, 3,3
    category2, 2, 1
    category3, 0, 0,15
    Sum, 3, 4,45Is there somebody with an idea?
    Thanks ahead,
    Tobias

    Hi Avinash,
    the problem is not the grouping it is the date format.
    Instead of a value like 5,4 > I want 05:40 or 1,75 > I want 02:15 in the sum value.
    In my table all time values are saved in the format hh24:mi.
    I don't know how to get that via a sql statement.
    Output I want:
    category_name, user_name, b_1, ..., b_31
    category1, user1, 122008, 01:00, ..., 03:30
    category2, user1, 122008, 02:00, ..., 01:00
    category3, user1, 122008, 00:00, ..., 00:15
    Sum, user1, 122008, 03:00, ..., 04:45Regards,
    Tobias

Maybe you are looking for

  • Windows 7 apple drivers wont install on Boot Camp

    When i go to install the drivers off the disc i get this error. "An error occured installing the package. Windows Installer returned '1620'." Has anyone had this problem? please help Im on Lion and installing to windows 7 professional

  • Downloading issue - Adobe Acrobat 9.0 Standard

    I'm having some problems downloading my Adobe 9.0 Standard from my account. The product and the serial number are both displayed under My orders, but when I press Download it says I have nothing to download. I just spoke to the Technical Support and

  • Create down payment request with reference to PO

    When we try to create the down payment request at F-47, can we copy the data from purchase order automatically instead of key in the items one by one?

  • Regarding Procedures and functions

    can we pass a cursor,table or ref cursor to a procedure and functions and can a function return cursor,table or ref cursor to a procedure and functions?please if possible give some examples with explanations thanks in advance..

  • How to train two line texts in NI Vision assistant ?

    Hi guys, I have managed to train single line of text in OCR (NI Assistant)..as attached..however I dont know how to train two (or more) line of texts..for example the car's plate number below: WDP 3194            - as attached  I want my script.scr f