Pivot Columns With Unique data

Hello All... Can any one help me in writing the query to get my output... 

@ Jinguang's ... Hey your solution worked for me.. Thank you.. I marked it as an
answer
@ Naomi..
I tried the solution provided by Jinguang's  and its working..And Yes as
you mention i replaced the GrandTotal calcluation with Sum(Amount)..which is working..
But, Certainly its the fix as of now.. might be in future i would definitely try the dynamic
pivot logic to handle the columns dynamically.. As of now they seem to be fixed no.of columns.. If the list increase then i cannot use this code ..so need to try that Pivot logic..
Thanks All..
Thanks, Anji

Similar Messages

  • How to insert data in a column with uniqueidefier data type

    Guys,
    I need insert data in a column with uniqueidefier data type, when i am trying to that getting error.
    error message says: "Conversion failed when converting from a character string to uniqueidentifier."
    I have data in table a col1,col2,col3,col4 - col3,col4 has datatype as varchar and i am updating table b columns col1,col2 with table a col3 and col4.
    Please guide how to do it.

    Hi,
    Not any String can be convert to uniqueidentifier.
    1. you have to make sure u use a value which is fir to be uniqueidentifier
    2. Use convert or cast in the insert query in order to convert the string into uniqueidentifier
    insert X ... convert(uniqueidentifier, 'string which fit to be convert to uniqueidentifier')
    Please post DDL+DML for more specific help
    DDL = Data Definition Language. In our case that is, CREATE TABLE statements for your tables and other definitions that are needed to understand your tables structure and there for let us to test and reproduce the problem in our server. Without DDL no one
    can execute any query.
    How to get DDL: Right click on the table in Object Explorer and select script table as CREATE. Post these create table scripts here.
    DML = data manipulation language is a family of queries used for manipulating the data it self like: inserting, deleting and updating data. In our case we need some sample data in order to check the query and get result, so we need some indert query for
    sample data.
    If you post a "create query" for the tables and "insert query" with some sample, then we could help you without Assuming/Guessing. There is a reason that DDL is generally asked for and expected when discussing query problems - it helps
    to identify issues, clarify terminology and prevent incorrect assumptions.  Sample data also provides a common point of reference for the discussion. A script that can be used to illustrate or reproduce the issue you have, will encourage others to help.
    [Personal Site] [Blog] [Facebook]

  • Not able to save date column with custom date format. in OBIEE 11g

    Hi,
    I have migrated one report from OBIEE 10g to 11g. There is a date column with customized date format(i.e. Default format is 'dd-MMM-yyyy' and I have used 'MMM-yyyy').
    But when I use this custom format and try to save the report in 11g its giving this below error.
    ''Catalog object privilege validation failed for user to path /shared/ALM BI/Finacial Results/History Income Statement Detail.
    You do not currently have sufficient privileges to save a report or dashboard page that contains HTML markup.
    This HTML might be present in column headings, table headings, text views, narrative views, the print header,
    or the print footer and must be removed before saving.''
    Please let me know what changes I need to do for this.
    Regards,
    Ambika Nanda.

    Hi ,
    privilage issues...check the security settings once..
    Thanks,
    Ananth

  • I am having trouble getting a numbers spreadsheet to hold different formats in the same column.  A column with a date formatted heading will not convert to $ for the cells below.   Any suggestions would help.

    I am having trouble getting a numbers spreadsheet to hold different formats in the same column.  A column with a date formatted heading will not convert to $ for the cells below.   Any suggestions would help.

    Hi Wayne,
    Thank you for this response.  I have tried this but when I start enterring $ amounts some, such as $6.00, go in OK others such as $4.00 appear as a date ie 4 Oct 12.  
    Kind regards
    Paul

  • Show all Columns with datatype = date

    Is it possible to select all columns with datatype = date in the Repository.
    We like to cast it like dd.mm.yyyy.
    Regards,
    Stefan

    Wouldn't it be easier to do it in the presentation services rather than the .rpd?
    Update: anyways, if you wanna be nasty, use something like this:
    CONCAT( CAST ( DAYOFMONTH("Siebel Data Warehouse"."Catalog"."dbo"."Dim_Incident (W_INCIDENT_D)"."CLOSED_DATE") AS VARCHAR ( 2 )), CONCAT('.', CONCAT( CAST ( EXTRACT( MONTH FROM "Siebel Data Warehouse"."Catalog"."dbo"."Dim_Incident (W_INCIDENT_D)"."CLOSED_DATE") AS VARCHAR ( 2 )), CONCAT('.', CAST ( EXTRACT( YEAR FROM "Siebel Data Warehouse"."Catalog"."dbo"."Dim_Incident (W_INCIDENT_D)"."CLOSED_DATE") AS VARCHAR ( 4 ))))))
    Message was edited by:
    ChrisBerg

  • Column with header data value

    Hi All.
    I have a control file which i need to add a column with header data value.
    example
    data file:
    123456;201303
    santiago;producto1;100
    santiago;producto2;200
    valparais;producto1;400
    valparais;producto3;900
    The control file skip the first column and load the three columns on the table, but, now i need to add other column with 201303 value constant of the first record and load it on the table.
    Then
    select * from table:
    santiago producto1 100 201303
    santiago producto2 200 201303
    valparais producto1 400 201303
    valparais producto3 900 201303
    How i do this in the control file?
    Regards!

    SCOTT@orcl_11gR2> host type test.dat
    123456;201303
    santiago;producto1;100
    santiago;producto2;200
    valparais;producto1;400
    valparais;producto3;900
    SCOTT@orcl_11gR2> host type test1.ctl
    options (load=1)
    load data
    infile test.dat
    replace
    into table onecol_onerow
    fields terminated by ';'
    trailing nullcols
    (filler1 filler, newcol)
    SCOTT@orcl_11gR2> host type test2.ctl
    options (skip=1)
    load data
    infile test.dat
    append
    into table test_tab
    fields terminated by ';'
    trailing nullcols
    (col1, col2, col3,
    newcol expression "(select newcol from onecol_onerow)")
    SCOTT@orcl_11gR2> create table onecol_onerow
      2    (newcol number)
      3  /
    Table created.
    SCOTT@orcl_11gR2> create table test_tab
      2    (col1   varchar2(15),
      3     col2   varchar2(15),
      4     col3   number,
      5     newcol number)
      6  /
    Table created.
    SCOTT@orcl_11gR2> host sqlldr scott/tiger control=test1.ctl log=test1.log
    SQL*Loader: Release 11.2.0.1.0 - Production on Mon May 6 10:46:44 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Commit point reached - logical record count 1
    SCOTT@orcl_11gR2> select * from onecol_onerow
      2  /
        NEWCOL
        201303
    1 row selected.
    SCOTT@orcl_11gR2> host sqlldr scott/tiger control=test2.ctl log=test2.log
    SQL*Loader: Release 11.2.0.1.0 - Production on Mon May 6 10:46:45 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Commit point reached - logical record count 4
    SCOTT@orcl_11gR2> select * from test_tab
      2  /
    COL1            COL2                  COL3     NEWCOL
    santiago        producto1              100     201303
    santiago        producto2              200     201303
    valparais       producto1              400     201303
    valparais       producto3              900     201303
    4 rows selected.

  • Query To update a date column with a date of my interest

    All,
    How to update a column in a table which is in date format with a date of my interest??
    Pls suggest.

    Please detail :
    1. what exactly you are trying to do
    2. what exactly you have done
    Nicolas.

  • Compare a varchar2 segment column with a date column

    Dear All ,
    i have a segment column with datatype varchar2 with data sample like '2013/06/09 00:00:00' , i want to compare this column with date column
    i tried many ways of conversion but not working like
    select to_date(TO_NCHAR(substr('2013/06/09 00:00:00',1,11),'DD-MM-YY'))DATE_C from dual ---> giving invalid number
    select TO_TIMESTAMP(TO_NCHAR(substr('2013/06/09 00:00:00',1,11),'DD-MM-YY'))DATE_C from dual ---> giving invalid number
    can i have any suggestion for that please
    thanks & best regards

    Hi,
    Have you tried:
    SELECT TO_DATE(SUBSTR('2013/06/09 00:00:00',1,10),'YYYY/MM/DD') DATE_C FROM dual
    Octavio

  • How to add custom columns with BO data from GP to UWL

    Hi
    We have CE 7.1 in our project UWL taskitems only have GP workflow tasks.
    In UWL we can see that by default there are standard columns but now we need to add custom columns with data from ours BO associated to process instance
    For that we need to develop one custom connector for UWL where we can retrieve the values from custom conenctor to UWL.
    Currently our NWDS 7.1 does not have plugins for UWL Connector can anybody tell me where can I download this plugins?
    thanks in advance!
    Regards
    Cristian

    Hi,
    plz refer the following link
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0ee5047-c7a0-2a10-70b7-9557e3e4d440
    Regards
    Manohar

  • Calculated Column with Null date end result needs to be text.

    Good Morning,
    I am using SharePoint 2010 and am trying to create a calculated column converting a date/time column to to show just a month and day.  Calculation is
    =TEXT([Anniversary],"m/d")
    This is to enable sorting on the month.  And this works fine except when there is no date entered in the "Anniversary" column.
    I have tried to modify the formula in this column to no avail.  http://social.technet.microsoft.com/Forums/sharepoint/en-US/0c9d5ae1-132a-4e02-8a91-c54708919d9a/show-calculated-date-column-as-null-when-there-is-no-date?forum=sharepointgenerallegacy
    I do not have access to modifying the code so have to work strictly OOB.  Any help would be greatly appreciated.

    I would think you could add an IF statement to verify if the text is null. So...
    =IF(ISNULL(TEXT(Anniversary, "m/d")), What we do when null, TEXT(Anniversary,"m/d"))
    Andy Wessendorf SharePoint Developer II | Rackspace [email protected]

  • How to generate a dynamic column with unique value in AMDP

    Hi Collegue,
    For AMDP I have a table with material plant,i have to assign a unique number to each unique combination of material,plants into a dynamic column say sequence.
    Please suggest me how to proceed.
    Regards,
    Saurabh

    hi
    Firstly, have a look at the following code to see how this can be implemented -
    REPORT ZTEST.
    perform test.
    class test definition.
      public section.
        methods: create_screen.
    endclass.
    class test implementation.
      method create_screen.
        data:  report_line(72),
               report_source like table of report_line.
        data: err_message(240),
              err_line type i,
              err_word(100).
        report_line = 'REPORT TEST.'.
        append report_line to report_source.
        report_line = 'PARAMETERS: P_TEST TYPE I.'.
        append report_line to report_source.
        report_line = 'START-OF-SELECTION.'.
        append report_line to report_source.
        report_line = 'WRITE : P_TEST.'.
        append report_line to report_source.
        syntax-check for report_source message err_message
                                       line    err_line
                                       word    err_word.
        if err_message is initial.
          INSERT REPORT 'ZZZTESTZZZ' FROM REPORT_SOURCE.
          SUBMIT ZZZTESTZZZ VIA SELECTION-SCREEN AND RETURN.
        endif.
      endmethod.
    endclass.
    form test.
      data test type ref to test.
      CREATE OBJECT TEST.
      call method test->create_screen.
    endform.
    As you can see, the report is being written dynamically. Once the INSERT REPORT statement is executed, the program is available. you can you external subroutine calls to pass the data between the programs now.
    Regards,
    ravish
    <b>plz dont forget to reward points if helpful</b>

  • How to autopopulate a text field with unique data from multiple data sets

    Hi,
    I'm a laboratory manager in charge of a hospital project which will be using pdf forms to send and receive data from our end users across the city. I need help with the last part of our pdf form, specifically with a js that will do a bit of text-field autopopulation magic. This, unfortunately, is a beyond what I have taught myself about pdf js functionality.a
    The problem:
    I need to provide my end users with a text field containing a set of data [A, B, C, D, E, F ...] and the total items in this set [tot#]. The end user needs this information as part of the implementation of this particular laboratory machine.
    The particulars
    When the end user asks for an experiment to be run, we must specify some pieces of data to help them interpret the results. These are constructed as panels which contain discrete data elements.
    For example - One experiment may use two panels, Panel#1 and Panel #2. Panel #1 includes the items A, B, D, E, Panel #2 includes the items A, B, C, F, G.
    Thus, the panels may share some of the same items, but, I only want the unique members to be displayed in the text field. If I make a drop down box or checkboxes with the panels, I want to  be able to select the panels that we ran and (in this example) have the text field display only the unique items among all the panels that were used:
    textfield outpute = A, B, C, D, E, F, G - 7 total.
    Any assistance from the pdf community would be very much appreciated.
    Thanks!

    Thanks for that help.
    I should have made it more apparent that I'm very new to scripting and I'm
    not a programmer by trade. I have a few questions before modifying the code
    you kindly provided.
    1) Where should I embed this script? Within the 'selection change' area of
    my listbox?
    2) Can I replace the term 'arr' with the names of the various items in my
    listbox or should I put 'arr#' as the output value for each term?
    3) Will this script find and display the unique values when a user selects
    multiple items in my listbox?
    4) How does the script know where to output the unique members of the
    combined set?
    I appreciate your patience with me.
    ck

  • ALV Grid Report spool problem with column with no data

    Hello All,
    I have created a simple alv grid report the report has a description field of 40 ch for which I have made the display length as 20 ch . This works fine in the foreground but when I run the report in background when there is no data in this column this being overwritten with the next column. Which is causing a mismatch between the header and the data below it.
    Also when I try to download the report in foreground into excel the columns are not matching with the headers this again happens for columns when there is no data.
    Kindly please suggest what is going wrong.
    Thanks,
    ranjan

    Hi,
    For checking the output from background job, check the job and enter JDBG in the command bar and execute.
    Check the field catalog and the table contents in debugging just before display.
    Edited by: Jayanthi Jayaraman on Dec 2, 2010 4:09 AM

  • Do ORACLE support indexing on the columns with Hebrew Data

    Hello Forum,
    I was working on an assignment with schemas containing Hebrew Data.
    Can i create indexes on the columns containing Hebrew Language data?
    Thanks
    Priyank Jain

    Varchar2; is something difficult for me. Reason why is I need to make change in my application throughout to accept this design change.
    My need of Index on Hebrew Data:
    Basically I am going to implement a Full-Text Search environment. For full-text searching; I am having a plugin which implements Lucene Algorithm of Indexing.
    The Index writing will not be useful until the table is indexed and well-functional.
    "But note that standard indexes will be sorted according to binary order of Hebrew letters in Unicode."
    So does it means we are not going to index on actual data (Data in Hebrew)??
    Thanks
    Priyank Jain

  • Reverse columns with GUID Data type

    Hi All,
    I want to reverse some of the SQL tables in Sunopsis to create the datastores. One column in these SQL tables has GUID data type and when i reverse this table, all other data being properly displayed but the reversed data store is not displaying data under the column.
    I have added GUID data type in topology in Physical Schema but still it is not working.
    Can you please suggest what should I check?
    Thank you so much in advance.
    Monalisa

    For some reason, this sounds like a technical question and not a comment or issue with the documentaiton.
    Can you suggest a more appropriate place to ask your question?

Maybe you are looking for

  • Advanced Sort, Filter (color, image size), DUPLICATES, face recognition, GUI customizeability

    Hi, here are some of my Lightroom Feature Requests (maybe later more): - Filter based on image size. Example: show me all photos with a resolution of 1600x1200 or less. - More complex filtering. Example: show me all photos from the Collection A that

  • Address Book images not syncing via .Mac sync

    i recently decided to get serious about attaching images to my contacts in address book. the images sync perfectly with the iphone, but they dont sync at all between the other copies of address book on the various macs in my home. the addresses (text

  • Using itv as a music server

    How can iTV best be used as a music server?

  • OSX 10.5.8 to Mavericks via Snow Leopard

    Hi there, I am taking my Imac from 10.5.8 to Snow Leopard then to Mavericks. There seems to quite about of info about this. I'll backup my personal folder to USB flash flash (pictues, music etc) before going to Snow Leopard. We have an iBook that is

  • REG: Page protection in Reports

    Hi,     I want to diplay particular contents in the same page without any page break. i.e Any equivalent command for Reports like SAPSCRIPT's PROTECT and ENDPROTECT? or what is the equivalent command SAPSCRIPT's PROTECT and ENDPROTECT in reports? Tha