Need help w/pivot table. dsplay multi cols as col delimited, data fm 2 tbls

I need to disply data from tbl 1 with qty's from tbl2.
disply qty's i.e. (if qyt_type = 'past', display column in ',' deliminated) as "Past_qty"
colmns in 1st tbl
name,pgm,type,code
aaa bbb 3 x
aaa ccc 3 z
colmns in 2nd tbl (first three cols are refer integ to the 1st tbl)
name,pgm,type,qty_type,qty
data in tbl 2
name pgm type qty_type qty
aaa bbb 3 past 0
aaa bbb 3 past 0
aaa ccc 3 past 1
aaa ccc 3 past 3
aaa bbb 3 present 0
aaa bbb 3 present 0
aaa bbb 3 future 0
aaa bbb 3 future 0
need it to look like this
name pgm type past_qty present_qty future_qty, code
aaa bbb 3 0,0 0,0 0,0 x
aaa ccc 3 1,3 z
there are 12 past qtys, 38 present qtys and 60 future qtys
thank you in advance

Oh well, guess I needed some little exercise.
Here it is:
SQL> create table first_table
  2  as
  3  select 'aaa' name, 'bbb' pgm, 3 type, 'x' code from dual union all
  4  select 'aaa', 'ccc', 3, 'z' from dual
  5  /
Tabel is aangemaakt.
SQL> create table second_table
  2  as
  3  select 'aaa' name, 'bbb' pgm, 3 type, 'past' qty_type, 0 qty from dual union al
  4  select 'aaa', 'bbb', 3, 'past', 0 from dual union all
  5  select 'aaa', 'ccc', 3, 'past', 1 from dual union all
  6  select 'aaa', 'ccc', 3, 'past', 3 from dual union all
  7  select 'aaa', 'bbb', 3, 'present', 0 from dual union all
  8  select 'aaa', 'bbb', 3, 'present', 0 from dual union all
  9  select 'aaa', 'bbb', 3, 'future', 0 from dual union all
10  select 'aaa', 'bbb', 3, 'future', 0 from dual
11  /
Tabel is aangemaakt.
SQL> select f.name
  2       , f.pgm
  3       , f.type
  4       , stragg(decode(s.qty_type,'past',s.qty)) past_qty
  5       , stragg(decode(s.qty_type,'present',s.qty)) present_qty
  6       , stragg(decode(s.qty_type,'future',s.qty)) future_qty
  7       , f.code
  8    from first_table f
  9       , second_table s
10   where f.name = s.name
11     and f.pgm = s.pgm
12     and f.type = s.type
13   group by f.name
14       , f.pgm
15       , f.type
16       , f.code
17  /
NAM PGM        TYPE PAST_QTY             PRESENT_QTY          FUTURE_QTY           C
aaa bbb           3 0,0                  0,0                  0,0                  x
aaa ccc           3 1,3                                                            z
2 rijen zijn geselecteerd.Regards,
Rob.

Similar Messages

  • Need help on Pivot Table

    Hi all,
    We are having 6 measures. My requirement is that all the 6 measures needs to placed in rows one after other(each measure in one row) And in column level Fiscal year should be displayed to the corresponding 6 measures. Is this possible in pivot table...
    Kindly help..urgent
    Thanx in advance...
    Regards,
    Naresh

    Place measure lables in the rows and year column in column and all the measures in measures

  • Need help with Pivoting rows to columns

    Hi,
    I need help with pivoting rows to columns. I know there are other posts regarding this, but my requirement is more complex and harder. So, please give me a solution for this.
    There are two tables say Table 1 and Table 2.
    Table1
    name address email identifier
    x e g 1
    f s d 2
    h e n 3
    k l b 4
    Table2
    identifier TRno zno bzid
    1 T11 z11 b11
    1 T12 z12 b12
    1 T13 z13 b13
    2 T21 z21 b21
    2 T22 z22 b22
    As you can see the identifier is the column that we use to map the two tables. The output should be like below
    output
    name address email identifier TRno1 zno1 bzid1 TRno2 zno2 bzid2 TRno3 zno3 bzid3
    x e g 1 T11 z11 b11 T12 z12 b12 T13 z13 b13
    f s d 2 T21 z21 b21 t22 z22 b22
    Also we do not know exactly how many TRno's, zno's, etc each value in the identifier will have. There may be only 1 TRNO, zno and bzid, or there may be four.
    All the values must be in separate columns, and not be just comma delimitted. There are also other conditions that i have to add to restrict the data.
    So, can you please tell me what is should use to get the data in the required format? We are using Oracle 10g. Please let me know if u need any more information

    Something like this ?
    SCOTT@orcl> ed
    Wrote file afiedt.buf
      1  select a.name,
      2  a.address,
      3  a.email,
      4  b.* from (
      5  select distinct identifier
      6  ,max(trno1) trno1
      7  ,max(zno1) zno1
      8  ,max(bzid1) bzid1
      9  ,max(trno2) trno2
    10  ,max(zno2) zno2
    11  ,max(bzid2) bzid2
    12  ,max(trno3) trno3
    13  ,max(zno3) zno3
    14  ,max(bzid3) bzid3
    15  ,max(trno4) trno4
    16  ,max(zno4) zno4
    17  ,max(bzid4) bzid4
    18  from (select identifier
    19  ,decode(rn,1,trno,null) trno1
    20  ,decode(rn,1,zno,null) zno1
    21  ,decode(rn,1,bzid,null) bzid1
    22  ,decode(rn,2,trno,null) trno2
    23  ,decode(rn,2,zno,null) zno2
    24  ,decode(rn,2,bzid,null) bzid2
    25  ,decode(rn,3,trno,null) trno3
    26  ,decode(rn,3,zno,null) zno3
    27  ,decode(rn,3,bzid,null) bzid3
    28  ,decode(rn,4,trno,null) trno4
    29  ,decode(rn,4,zno,null) zno4
    30  ,decode(rn,4,bzid,null) bzid4
    31  from (select identifier,
    32  trno,bzid,zno,
    33  dense_rank() over(partition by identifier order by trno,rownum) rn
    34  from table2)
    35  order by identifier)
    36  group by identifier) b,table1 a
    37* where a.identifier=b.identifier
    SCOTT@orcl> /
    NAME       ADDRESS    EMAIL      IDENTIFIER TRNO1      ZNO1       BZID1      TRNO2      ZNO2       BZID2      TRNO3      ZNO3       BZID3      TRNO4      ZNO4       BZID4
    x          e          g          1          T11        z11        b11        T12        z12        b12        T13        z13        b13
    f          s          d          2          T21        z21        b21        T22        z22        b22
    SCOTT@orcl> select * from table1;
    NAME       ADDRESS    EMAIL      IDENTIFIER
    x          e          g          1
    f          s          d          2
    h          e          n          3
    k          l          b          4
    SCOTT@orcl> select * from table2;
    IDENTIFIER TRNO       ZNO        BZID
    1          T11        z11        b11
    1          T12        z12        b12
    1          T13        z13        b13
    2          T21        z21        b21
    2          T22        z22        b22
    SCOTT@orcl>Regards
    Girish Sharma

  • Help in Pivot Table (or another ways)

    I need to do following view in the report,can anyone tell me how can I do that??
    This is original report:
    DATE          AMOUNT1 AMOUNT2 AMOUNT3
    01/02/2009 5 6 7
    02/02/2009 2 3 4
    I want to change this view into this:
    01/02/2009 02/02/2009
    AMOUNT1 5 6
    AMOUNT2 6 3
    AMOUNT3 7 4
    How can I do this? Please help me..

    Have a look here:
    http://obiee101.blogspot.com/2008/05/obiee-pivot-table-measure-label.html
    regards
    John
    http://obiee101.blogspot.com

  • Help with pivot tables in excel

    Hello,
    I need some help with a very specific issue I am getting in excel.
    So, I have this pivot table that gets data from an external source (a huge database) and everything is working fine.
    The problem comes with some lines in our database that are written in asian letters (the thai alphabet). Every thai entry that we import appears like ????????.
    I can look into the DB (via MySQL Workbench) and everything is alright in there. I can also just copy some of the content into excel and the letters shows up normally.
    Is there something I can do to fix it?
    Thank you very much
    Daniel Ayres

    I can see it is working fine for roman/latin characteres, and it is not working for thai or japanese characteres. Since I dont have data written using the russian or the arabic alphabet, there is no way I can tell you if it would or not work..

  • Need help in SQL table creation

    Hi All,
    I created a table a month back.Now i need to create another table of the same structure.
    Is there any way so dat i can get the script of the table which i created earlier and use the same to create another.
    Or is there another way so that we can create a table with same structure of the existing table.
    Please help.
    Regards,
    Mohan

    Check out the [DBMS_METADATA.GET_DDL|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_metada.htm#i1019414] function.
    Example:
    SQL> SET LONG 5000
    SQL> SELECT DBMS_METADATA.GET_DDL('TABLE','EMP','SCOTT') FROM DUAL;
    DBMS_METADATA.GET_DDL('TABLE','EMP','SCOTT')
      CREATE TABLE "SCOTT"."EMP"
       (    "EMPNO" NUMBER(4,0),
            "ENAME" VARCHAR2(10),
            "JOB" VARCHAR2(9),
            "MGR" NUMBER(4,0),
            "HIREDATE" DATE,
            "SAL" NUMBER(7,2),
            "COMM" NUMBER(7,2),
            "DEPTNO" NUMBER(2,0),
             CONSTRAINT "PK_EMP" PRIMARY KEY ("EMPNO")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"  ENABLE,
             CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO")
              REFERENCES "SCOTT"."DEPT" ("DEPTNO") ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"Edited by: Centinul on Jan 11, 2010 8:01 AM

  • I Need Help In Deleting Table row by clicking on "Delete" button inside the

    Dear all,
    first i'm new to Swing
    i have created table with customized table model, i fill this table using 2d array, this table rows contains JButtons rendered using ButtonRenderer.java class and action listeners attached by the AbstractButtonEditor.java
    what iam trying to do is when i click on a specified button in table row i want this row to be deleted, i found some examples that uses defaultTableModelRef.removeRow(index), but iam using customized table model and the following is my code
    JTable tblPreview = new JTable();
              DbExpFormTableModel model = new DbExpFormTableModel();               
              tblPreview.setModel(model);
    //adding the edit button          
              tblPreview.getColumn("Edit").setCellRenderer(new ButtonRenderer());
              tblPreview.getColumn("Edit").setCellEditor(new AbstractButtonEditor(new JCheckBox()));
              //adding the delete button
              tblPreview.getColumn("Delete").setCellRenderer(new ButtonRenderer());
              tblPreview.getColumn("Delete").setCellEditor(new AbstractButtonEditor(new JCheckBox()));
    and here is the code of the code of my customized table model ( DbExpFormTableModel )
    public class DbExpFormTableModel extends GeneralTableModel
         public DbExpFormTableModel()
              setColumnsNames();
              fillTable();          
         private void setColumnsNames()
              columnNames = new String [5];
              columnNames[0] = "ID";
              columnNames[1] = "Database ID";
              columnNames[2] = "Prestatement";
              columnNames[3] = "Edit";
              columnNames[4] = "Delete";
         private void fillTable()
              int numOfRows = 2;     // = getNumberOfRows();
              data = new Object[numOfRows][5];          
              data[0][0] = "1"; //we must get this value from the database, it is incremental identity
              data[0][1] = "AAA";
              data[0][2] = "insert into table 1 values(? , ? , ?)";
              data[0][3] = "Edit";
              data[0][4] = "Del";
              data[1][0] = "2"; //we must get this value from the database, it is incremental identity
              data[1][1] = "BBB";
              data[1][2] = "insert into table2 values(? , ? , ? , ?)";
              data[1][3] = "Edit";
              data[1][4] = "Del";
    and this is the GeneralTableModel class
    public class GeneralTableModel extends AbstractTableModel implements Serializable
         public static Object [][] data;
         public static String[] columnNames;
         //these functions should be implemented to fill the grid
         public int getRowCount()
              return data.length;
         public int getColumnCount()
              return columnNames.length;
         public String getColumnName(int col)
    return columnNames[col];
         public Object getValueAt(int row , int col)
              return data[row][col];
         //i've implemented this function to enable events on added buttons
         public boolean isCellEditable(int rowIndex, int columnIndex)
              return true;
         public Class getColumnClass(int c)
    return getValueAt(0, c).getClass();
    public void setValueAt(Object value, int row, int col)
    //fireTableDataChanged();          
    data[row][col] = value;          
    fireTableCellUpdated(row, col);     
    And Now what i want to do is to delete the clicked row from the table, so please help me...
    thank you in advance

    Hi Sureshkumar,
    1. Create a value attribute named <b>select</b> of type boolean.
    2. Bind the <b>checked property</b> of all the checkboxes to this attribute.
    3. Create an action called <b>click</b> and bind it to <b>OnAction</b> event of the button(whose click will check all the checkboxes) and write this code in that action.
    <b>wdContext.currentContextElement().setSelect(true);</b>
    Warm Regards,
    Murtuza

  • Required Help in Pivot Table

    Dear
    i am working on BI Publisher Desktop Version and trying to generate a RTF Template in which pivot table has to be used
    Below is the format of my XML File.
    -<G_C1>
    <R>1</R> row 1
    <C>1</C> column 1
    <C1>1300001 ASL 112531 2</C1>
    <C2>1 10 1.5</C2>
    <C3>120000105 12.5</C3>
    <C4>120000105 </C4>
    <C5>OPeration</C5>
    </G_C1>
    -<G_C1>
    <R>1</R> row 1
    <C>2</C> column 2
    <C1>1300001 ASL 112531 2</C1>
    <C2>2 10 1.5</C2>
    <C3>120000106 12.5</C3>
    <C4>120000106 </C4>
    <C5>OPeration</C5>
    </G_C1>
    -<G_C1>
    <R>1</R> row 1
    <C>3</C> column 3
    <C1>1300001 ASL 112531 2</C1>
    <C2>3 10 1.5</C2>
    <C3>120000107 12.5</C3>
    <C4>120000107 </C4>
    <C5>OPeration</C5>
    </G_C1>
    ......... and sow on till row 16 and column 8
    i am facing two issues,
    first i have to show 5 columns in cross product, but pivot table option shows option for 4 columns only
    secondly characters are not shown when i preview the template its shows 'NnN' in all columns
    Kindly help me in generating the template.
    I have to define the template in XML Publisher of Oracle E-Business Suite R12
    Regards,
    Muhammad Usman

    check these samples
    http://winrichman.blogspot.com/2008/08/pivot-table-cross-table-with-fixed.html
    and
    https://blogs.oracle.com/xmlpublisher/entry/new_skool_crosstabbing
    i will let you if i know i get anything.

  • Need help in quering table in loop

    I have following scenario and need some help:
    I have Table A from there I need to select NAME in LOOP and query Table B with each name.
    Table B can give me more than one record per call and then I have to select the best record and update the Table A with Table B values (best row).
    I have created a global temp table and insert the table B results in that table and then loop through Temp table to decide which record is best. Then update the Table A.
    This solution is working but is very slow. I have created indexes on all the tables but still very slow. Is there any solution to make it fast?
    Thanks

    skas wrote:
    I have following scenario and need some help:
    I have Table A from there I need to select NAME in LOOP and query Table B with each name.
    Table B can give me more than one record per call and then I have to select the best record and update the Table A with Table B values (best row).
    I have created a global temp table and insert the table B results in that table and then loop through Temp table to decide which record is best. Then update the Table A.
    This solution is working but is very slow. I have created indexes on all the tables but still very slow. Is there any solution to make it fast?
    ThanksDon't use PL/SQL loops, don't use GTT's, do it in plain sql. If you post the table descriptions and some sample data (preferrably in the form of cretate table and insert statement) and explain how you determine "the best record" in table B I'm sure that someone here could help you with the requirements.
    John

  • Help in Pivot Table

    Hi
    How to show grand total two times in pivot table?is it possible
    Thanks in Advance

    Have a look here:
    http://obiee101.blogspot.com/2008/05/obiee-pivot-table-measure-label.html
    regards
    John
    http://obiee101.blogspot.com

  • Need help with PIVOT

    Hi All,
    i'm using the following query to get data from two different tables.
    SELECT DISTINCT t1.[b1_alt_id],
                    sd_pro_des,
                    sd_app_des,
                    T2.g6_stat_dd,
                    T2.rec_date,
                    CASE
                      WHEN sd_app_des = 'Application Accepted' THEN g6_stat_dd
                      ELSE NULL
                    END AS appl_accepted_date,
                    CASE
                      WHEN sd_app_des = 'Renewal License Accepted' THEN g6_stat_dd
                      ELSE NULL
                    END renewal_accepted_date,
                    CASE
                      WHEN sd_app_des = 'Issued' THEN g6_stat_dd
                      ELSE NULL
                    END AS Issued_date
    FROM   [b1permit] t1,
           [gprocess] t2
    WHERE  t1.serv_prov_code = t2.serv_prov_code
           AND t1.b1_per_id1 = t2.b1_per_id1
           AND t1.b1_per_id2 = t2.b1_per_id2
           AND t1.b1_per_id3 = t2.b1_per_id3
           AND t1.b1_per_group = 'Licenses'
           AND t1.b1_per_type IN ( 'Company', 'Company Adult Enterprises',
                                   'Company Adult Entertainment',
                                                         'Complaint',
                                   'Individual', 'Individual Adult Enterprises',
                                   'Legal',
                                       'Special Event Civic',
                                                         'Special Event Non Civic' )
            AND t1.b1_per_category != 'History'
           AND t1.rec_status = 'A'
           AND T2.sd_app_des IN ( 'Application Accepted', 'Issued',
                                  'Renewal License Accepted',
                                  'Accepted' )
           AND T2.sd_pro_des IN ( 'Application Submittal', 'License Status' )
           AND T1.b1_appl_status = 'Issued'
    GROUP  BY t1.[b1_alt_id],
              t1.[b1_appl_status],
              t1.[b1_module_name],
              t2.sd_stp_num,
              T2.sd_pro_des,
              T2.sd_bureau_code,
              T2.sd_app_des,
              T2.g6_app_dd,
              T2.g6_stat_dd,
              T2.g6_asgn_dd,
              T2.rec_date
    ORDER  BY t1.b1_alt_id  And i'm having the following out put.
    b1_alt_id     sd_pro_des     sd_app_des     g6_stat_dd     rec_date     appli_accepted_date     renewal_accepted_date     issued_date
    LAC-000004     Application Submittal     Application Accepted     2/1/12 12:00 AM     2/1/12 9:22 AM     2/1/12 12:00 AM     NULL     NULL
    LAC-000004     License Status     Issued     2/2/12 12:00 AM     2/2/12 8:18 AM     NULL     NULL     2/2/12 12:00 AM
    LAC-000005     Application Submittal     Renewal License Accepted     1/24/12 12:00 AM     1/24/12 5:52 PM     NULL     1/24/12 12:00 AM     NULL
    LAC-000005     License Status     Issued     2/15/12 12:00 AM     2/15/12 10:03 AM     NULL     NULL     2/15/12 12:00 AMBut what i'm expecting is
    b1_alt_id     Application Accepted     Renewal License Accepted     Issued
    LAC-000004     2/1/12 12:00 AM          2/2/12 12:00 AM
    LAC-000005          1/24/12 12:00 AM     2/15/12 12:00 AMCan anyone please advice me what i should do?
    Thanks

    Hi,
    thinkingeye wrote:
    Can anyone please advice me what i should do?Sure. Post CREATE TABLE and INSERT statements for ypur sample data, and the results you want from that data (if not what you've already posted).
    Always say which version of Oracle you're using. If you're not using Oracle (the square brackets, as in "SELECT DISTINCT t1.[b1_alt_id]", make me wonder), then explain what you are using, and why you're posting the question on an Oracle forum.
    See the forum FAQ {message:id=9360002}
    The forum FAQ also has a section on pivoting: {message:id=9360005} Use one of the techniques from there.
    Post your best attempt, and point out where it is producing the wrong output. If you're getting an error message, post the complete error message.

  • SSAS Default Member Causing incorrect data in Excel Pivot Table using Multi-select in filter

    I have an Excel 2013 pivot table connected to an SSAS (2012) cube. One of my dimensions has a default member specified. When I drop this dimension in the filter area of my pivot table and select multiple members including the default member then
    only data for the default member is shown. Selecting multiple members where the default member is not included does not result in an issue.
    I believe this may be in an issue in how Excel builds the MDX but wanted to see if there are any work arounds.
    This issue can be recreated using AdvetureWorks using the following steps:
    Alter the Product Dimension of the SSAS Default Member by setting the default member of the Product Line Attribute to Mountain: [Product].[Product Line]&[M] 
    Process the cube
    Connect to the cube via Excel 2013
    Drag internet gross profit to the Values area (The value will be 4700437.22 which reflects the Mountain default filter)
    Drag Product Model Lines to the Filters area (you will see Mountain selected by default)
    Change the filter by checking the Select Multiple Items checkbox and checking Mountain and Road (You will see that the amount does not change)
    Change the filter again by selecting Road only (to demonstrate that Road has a value, 5602105.8, associated with it)
    Change the filter again to select Road and Touring (to demonstrate that the correct aggregation of the two selected members is preformed)

    Hi Hirmando,
    According to your description, the default member cause incorrect data when dragging a attribute that contain a default member to the FILTERS area, right?
    I can reproduce this issue on my environment, when dropping this dimension in the filter area of my pivot table and select multiple members including the default member then only data for the default member is shown. Currently, it's hard to say the root
    reason that cause this issue. In order to narrow down this issue, please apply the latest server pack and cumulative update.
    Besides, you can submit a feedback at
    http://connect.microsoft.com/SQLServer/Feedback So that microsoft will confirm if this is a know issue.
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    Charlie Liao
    TechNet Community Support

  • Need help with JSF table and scrollable pages

    I need help regarding usage of <t:dataTable>
    I have a List on my managed bean. It has 50 records.
    I am displaying the first 10 records and need to implement paging.
    I hear that there is a faces taglibrary called tomahawk which provides a <t:dataTable> and a <t:dataScroller> to implement scrolling.
    Is there a sample implentation that I can take a look at to see how I can solve my problem??
    Any help is highly appreciated.
    Thanks
    Amol

    Check here: http://www.irian.at/myfaces/dataScroller.jsf;jsessionid=F3F50A51583FEEF38D968A4AF5DC949C

  • Need to update a table that contains large volume of xml data

    Hi,
    i want to update a table that contains large amount of XML data.
    when execute the query it shows an error .
    Xml parsing is failed .But tghe data in xml is well formed.don't know why its happening .
    Pls help me on this.
    Thanks,
    Fahad

    below is my code..
    pls do the needful.
    create or replace
    PROCEDURE SPFETCHRETRIEVEDATA (
        p_txteordernum IN trnorderitem.TXTEORDERNUM%TYPE,
        p_intversionnum IN trnorderitem.INTVERSIONNUM%TYPE ,
        p_interrorcode OUT NUMBER)
        AS
        ------variable declaration---
        v_xmlorderitem XMLTYPE;
        v_trnsiebelmodification XMLTYPE;
        diff XMLTYPE;
            BEGIN
                BEGIN
                select xmlorderitemxml into v_xmlorderitem
                from trnorderitem
                where TXTEORDERNUM= p_txteordernum
                AND INTVERSIONNUM= p_intversionnum;
                  END;
               --insert into tempxml values ('xmlorderitem',v_xmlorderitem);commit;
                BEGIN
                SELECT TrnSiebelModificationXML into v_trnsiebelmodification
                from trnsiebelmodification
                where TXTEORDERNUM= p_txteordernum
                AND INTVERSIONNUM= p_intversionnum
                AND TXTSIEBELFIELDNAME='Asset XML';
              --  insert into tempxml values ('trnsiebelmodification',v_trnsiebelmodification);commit;
    --            EXCEPTION
    --            WHEN TOO_MANY_ROWS THEN
    --            dbms_output.put_line('Statement return multiple rows');
                 END;
    --------comparing differences between xml data and storing into a variable -----------
               BEGIN
               select xmldiff(v_xmlorderitem, v_trnsiebelmodification)
               into   diff
               from   dual;
               --insert into tempxml values ('diffxml',diff);commit;
               if diff IS NOT NULL THEN
               UPDATE trnsiebelmodification
                SET TXTACTIONTYPE='Update2'
                WHERE TXTEORDERNUM= p_txteordernum
                AND INTVERSIONNUM= p_intversionnum
                 AND TXTSIEBELFIELDNAME='Asset XML';
                ELSE
                UPDATE trnsiebelmodification
                SET TXTACTIONTYPE='No Change2'
                WHERE TXTEORDERNUM= p_txteordernum
                AND INTVERSIONNUM= p_intversionnum
                 AND TXTSIEBELFIELDNAME='Asset XML';
                END IF;
                END;
        END SPFETCHRETRIEVEDATA;Edited by: BluShadow on 11-Sep-2012 14:13
    added {noformat}{noformat} tags. Please read: {message:id=9360002} and learn to do this yourself.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Need help with Expressions to get the sum of rows between dates

     Date              Total
    8/06/2010     $2000
    8/10/2010    $5000
    8/28/2010      $2500
    9/10/2010    $5000
    9/16/2010   $2000
    9/25/2010   $7000
    9/28/2010     $2500
    I need sum of rows based on month. I have tried  following syntax. It did not work, which is returning $0.  Appreciate any help i get.
    =sum(iif(Date.value>="8/01/2010" AND Date.value<="8/30/2010",Total.value,0))

    Hi RG K,
    According to your description, you want to calculate sum of total based on month use expression, but the expression does not work. If that is the case, please refer to the following steps:
    In design surface, right-click Insert and click Text Box.
    Right-click inside of the text box, then click expression.
    In Expression text box, type the expression like below:
    =sum(iif(Fields!Date.Value>="8/01/2010" AND Fields!Date.Value<="8/30/2010",Fields!total.Value,CDec(0)))
    In this expression, the data type of total is Decimal, so we need to convert 0 to Decimal use CDec() function. If data type of total is Double, we need to use CDbl() function.
    The following screenshot is for your reference:
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

Maybe you are looking for

  • Duplicate subtree in PI 7.1 (EHP1) not working as it did in XI 3.0

    Hello, When I duplicate a subtree with occurrence of 0---Unbounded in PI 7.1 (EHP1), the node gets duplicated but without the occurrence and type in the duplicated node. When duplicating a subtree with occurrence of 0---Unbounded  in XI 3.0, the occu

  • Problem with ComboBox / Matrix

    Hi all, I have this problem... when I try to populate a column with comboxbox ... Code:         Set co = lmatrix.Columns.Add("orgDist", it_COMBO_BOX)             co.TitleObject.Caption = "Dist"             co.Editable = True             co.Visible =

  • Removed photos from internal hard drive (iPhoto), but it also removed from my external hard drive (iPhoto). HELP!!

    I just bought a new external hard drive (Seagate) to move my numerous photos in iPhoto off my iMac. Set the EHD up to work on both Mac & PC. When I removed some of the photos in the iPhoto library on my internal drive it also removed them from the EH

  • Creating Java Proxies

    Hi all, We have a scenario for RFC -> Xi -> Java Application. We need to inoke certain functionlities provided by the java application through RFC. As per my understanding, i need to create the relevant interfaces and then invoke the java application

  • I have my mail archived from 2010 and before in Tbird. But there's no .exe file there.

    I've downloaded the current version, but can't get it to look at the archived file. The directory in which the archive version is stored is xfjhnx9.Matt.Minahan Or, is there any way to find the mail file that directory? I don't see anything plausible