Repeating hearder on each group record?

Hi guys.
Currently my report consists of different products in 1 day, and each products have around 40 records. So I'm thinking to make the header appear at the top of each new product data, this is to improve the convenient to view the report,  because each
data consists about 30 figures and make the report very long.
Is there anyway to do this?
Thanks in advance.

Thank you Sanjeewan. Your comment helped to fix this (The tablix 'table1' has an invalid TablixMember. All TablixMember
elements in a TablixColumnHierarchy must have the KeepWithGroup property set to "None")  issue. 
Fix Which I made:
1. inserted row outside of group .. to avoid repeated headers on each row . 
2. After that can see row groups and column group on bottom of the report.. there is arrow mark click on that selected advanced mode. 
3. In row group side: can see static and details. Click on static and set Repeat on NewPage to  True.  If we select on static column on column group side
will get that error again (this was the mistake which I have done)
---------------- Hope this helps----------------
Vishali

Similar Messages

  • Want to get sum/avg first 90% records  in each grouped record set.

    Hi Gurus,
    Need your help or example query which help me to achieve sum/avg first 90% records in each grouped record set. Let me show you the basic query and output and proposed output.
    select Pid, Sum(SalesAmt) TotalSaleAmt, Avg(SalesAmt) AvgSaleAmt, count(*) NoOfSales from ProductSales group by Pid;
    PID TotalSaleAmt AvgSaleAmt NoOfSales
    1 12000 100 120
    2 24000 50 480
    Now I need for PID =1 TotalSaleAmt of first 90% of NoOfSale i.e.120(this is basically nuber of rows found in PrdocutSales Table).
    I hope I am clear enough explain my requirement... I would appreciate if we have some Analytical function available..
    Gurus Pls help me asap..
    Thanks In adavance...
    Srichan.

    Now I need for PID =1 TotalSaleAmt of first 90% of NoOfSale i.e.120(this is basically nuber of rows found in PrdocutSales Table).
    first 90% should mean first 90% by some order, so in this case, which 108 rows (of the 120) do you want to take into consideration?
    with
    the_sample as
    (select 1 the_pid,10 the_sale,1 the_order from dual union all
    select 1 the_pid,20 the_sale,2 the_order from dual union all
    select 1 the_pid,15 the_sale,3 the_order from dual union all
    select 1 the_pid,12 the_sale,4 the_order from dual union all
    select 1 the_pid,12 the_sale,5 the_order from dual union all
    select 1 the_pid,13 the_sale,6 the_order from dual union all
    select 1 the_pid,19 the_sale,7 the_order from dual union all
    select 1 the_pid,11 the_sale,8 the_order from dual union all
    select 1 the_pid,15 the_sale,9 the_order from dual union all
    select 1 the_pid,12 the_sale,10 the_order from dual union all
    select 2 the_pid,25 the_sale,1 the_order from dual union all
    select 2 the_pid,22 the_sale,2 the_order from dual union all
    select 2 the_pid,22 the_sale,3 the_order from dual union all
    select 2 the_pid,23 the_sale,4 the_order from dual union all
    select 2 the_pid,29 the_sale,5 the_order from dual union all
    select 2 the_pid,21 the_sale,6 the_order from dual union all
    select 2 the_pid,25 the_sale,7 the_order from dual union all
    select 2 the_pid,22 the_sale,8 the_order from dual
    select the_pid,the_sum,the_avg
      from (select the_pid,
                   sum(the_sale) over (partition by the_pid order by the_order) the_sum,
                   round(avg(the_sale) over (partition by the_pid order by the_order),2) the_avg,
                   the_order,
                   floor((0.9 * max(the_order) over (partition by the_pid))) to_pick
              from the_sample
    where the_order = to_pickRegards
    Etbin

  • SQL to group the records and apply logic to pick one record from each group

    Hi Friends,
    I am looking for a query to group the records on certain columns in a table and then from each group I want to pick only one record based on certain rules.
    May be having data laid out will make my point more clear to you. Here you go :
    CREATE TABLE AD_LIST
      FILE_NAME             VARCHAR2(50 BYTE),
      ACTIVITY_START        DATE,
      ACTIVITY_END          DATE,
      DIVISION              VARCHAR2(50 BYTE),
      ITEM_CODE             VARCHAR2(50 BYTE),
      MULT                  NUMBER,
      RETAIL                NUMBER,
      AD_PAGE               VARCHAR2(1 BYTE),
      FORECAST              NUMBER,
      MEMO                  VARCHAR2(50 BYTE)
    INSERT INTO AD_LIST VALUES ('FILE_1','01-APR-2010','15-APR-2010','B',1111,5,10,'A',10,'This must be in my result');
    INSERT INTO AD_LIST VALUES ('FILE_1','01-APR-2010','15-APR-2010','B',1111,1,1,'B',15,'Must not be in my result');
    INSERT INTO AD_LIST VALUES ('FILE_1','01-APR-2010','15-APR-2010','B',1111,6,15,'C',11,'Must not be in my result');
    INSERT INTO AD_LIST VALUES ('FILE_1','16-APR-2010','30-APR-2010','N',1111,4,20,'D',40,'Must not be in my result');
    INSERT INTO AD_LIST VALUES ('FILE_1','16-APR-2010','30-APR-2010','N',1111,5,15,'E',30,'Must not be in my result');
    INSERT INTO AD_LIST VALUES ('FILE_1','16-APR-2010','30-APR-2010','N',1111,1,2,'F',20,'This must be in my result');
    CREATE TABLE PAGE_RANK
      AD_PAGE VARCHAR2(1 BYTE),
      RANK NUMBER
    INSERT INTO PAGE_RANK VALUES ('A',1);
    INSERT INTO PAGE_RANK VALUES ('B',2);
    INSERT INTO PAGE_RANK VALUES ('C',3);
    INSERT INTO PAGE_RANK VALUES ('D',4);
    INSERT INTO PAGE_RANK VALUES ('E',5);
    INSERT INTO PAGE_RANK VALUES ('F',6);
    COMMIT;
    SELECT * FROM AD_LIST
    FILE     ACTIVITY     ACTIVITY          ITEM               AD
    NAME     START          END          DIV     CODE     MULT     RETAIL     PAGE     FORECAST     MEMO
    FILE_1     4/1/2010     4/15/2010     B     1111     5     10     A     10     This must be in my result
    FILE_1     4/1/2010     4/15/2010     B     1111     1     1     B     15     Must not be in my result
    FILE_1     4/1/2010     4/15/2010     B     1111     6     15     C     11     Must not be in my result
    FILE_1     4/16/2010     4/30/2010     N     1111     4     20     D     40     Must not be in my result
    FILE_1     4/16/2010     4/30/2010     N     1111     5     15     E     30     Must not be in my result
    FILE_1     4/16/2010     4/30/2010     N     1111     1     2     F     20     This must be in my resultNow, from the table AD_LIST I want to group the records based on FILE_NAME, ACTIVITY_START, ACTIVITY_END, DIVISION, ITEM_CODE.
    So in my example here we have 2 set of records grouped based on the columns specified.
    Also we have one more table, PAGE_RANK, which has a rank corresponding to each ad_page number. Here 1 is higher rank than 2. Hence ad page 'A' takes priority over 'B'. Similarly for all other ad pages.
    Now, we need to pick one ad from each group of ads by determining the highest ranked ad page within the group and the value for mult and retail must be replaced with the value that has min(retail/mult). So, using the above data we will have the one having ad page = 'A' and ad page = 'D' as the final results since they have highest ad page rank in their group.
    The value for mult and retail values for ad_page 'A' = min (10/5 , 1/1, 15/6) = 1,1(mult,retail).
    The value for mult and retail values for ad_page 'D' = min (20/4 , 15/5, 2/1) = 1,2(mult,retail).
    Finally I have this query below
    SELECT a.file_name,
           a.activity_start,
           a.activity_end,
           a.division,
           a.item_code,
           FIRST_VALUE (a.mult) OVER (PARTITION BY a.file_name, a.activity_start, a.activity_end, a.division, a.item_code ORDER BY (a.retail /
                                                                                                                                    a.mult))
                                                                                                        mult,
           FIRST_VALUE (a.retail) OVER (PARTITION BY a.file_name, a.activity_start, a.activity_end, a.division, a.item_code ORDER BY (a.retail /
                                                                                                                                      a.mult))
                                                                                                      retail,
           FIRST_VALUE (a.ad_page) OVER (PARTITION BY a.file_name, a.activity_start, a.activity_end, a.division, a.item_code ORDER BY (b.RANK))
                                                                                                     ad_page,
           a.forecast,
           a.memo                                                                                                
      FROM ad_list a, page_rank b
    WHERE a.ad_page = b.ad_pageThis query is giving me all the records but with the values what I wanted in Ad_Page, Mult and Retail columns.
    How can I pick only one from each group.
    I am getting this FILE     ACTIVITY     ACTIVITY          ITEM               AD
    NAME     START          END          DIV     CODE     MULT     RETAIL     PAGE     FORECAST     MEMO
    FILE_1     4/1/2010     4/15/2010     B     1111     1     1     A     15     Must not be in my result
    FILE_1     4/1/2010     4/15/2010     B     1111     1     1     A     10     This must be in my result
    FILE_1     4/1/2010     4/15/2010     B     1111     1     1     A     11     Must not be in my result
    FILE_1     4/16/2010     4/30/2010     N     1111     1     2     D     20     This must be in my result
    FILE_1     4/16/2010     4/30/2010     N     1111     1     2     D     30     Must not be in my result
    FILE_1     4/16/2010     4/30/2010     N     1111     1     2     D     40     Must not be in my resultBut I want this FILE     ACTIVITY     ACTIVITY          ITEM               AD
    NAME     START          END          DIV     CODE     MULT     RETAIL     PAGE     FORECAST     MEMO
    FILE_1     4/1/2010     4/15/2010     B     1111     1     1     A     10     This must be in my result
    FILE_1     4/16/2010     4/30/2010     N     1111     1     2     D     20     This must be in my resultI have to run this query for thousands of such group combination.
    Hope some one can throw some light on this query.
    Thanks in advance,
    Raj.

    Frank,
    You are marvelous.
    That is what I was expecting, but basically I want to display the row with highest page rank which is 'A' and 'D' in this case.
    So I have changed my query as below using yours :
    WITH mainq AS
         (SELECT a.file_name,
                 a.activity_start,
                 a.activity_end,
                 a.division,
                 a.item_code,
                 FIRST_VALUE (a.mult) OVER (PARTITION BY a.file_name, a.activity_start, a.activity_end, a.division, a.item_code ORDER BY (a.retail /
                                                                                                                                          a.mult))
                                                                                                        mult,
                 FIRST_VALUE (a.retail) OVER (PARTITION BY a.file_name, a.activity_start, a.activity_end, a.division, a.item_code ORDER BY (a.retail /
                                                                                                                                            a.mult))
                                                                                                      retail,
                 --FIRST_VALUE (a.ad_page) OVER (PARTITION BY a.file_name, a.activity_start, a.activity_end, a.division, a.item_code ORDER BY (b.RANK))
                 a.ad_page,
                 a.forecast,
                 a.memo,
                 ROW_NUMBER () OVER (PARTITION BY a.file_name, a.activity_start, a.activity_end, a.division, a.item_code ORDER BY b.RANK)
                                                                                                 AS r_num
            FROM ad_list a, page_rank b
           WHERE a.ad_page = b.ad_page)
    SELECT *
      FROM mainq a
    WHERE r_num = 1
    FILE     ACTIVITY     ACTIVITY          ITEM               AD
    NAME     START          END          DIV     CODE     MULT     RETAIL     PAGE     FORECAST     MEMO
    FILE_1     4/1/2010     4/15/2010     B     1111     1     1     A     10     This must be in my result
    FILE_1     4/16/2010     4/30/2010     N     1111     1     2     D     40     Must not be in my resultMy apologies that I gave you wrong forecast and memo values in my earlier post.
    But that is what I wanted and your input greatly helped me to save lot of time by using in one single query.
    Earlier I was using cursor to do that and it was not doing any good performance wise.
    Thanks to every body for your time and your efforts.
    I appreciate it.
    Have fun.
    ~Raj

  • Getting the first row for each group

    Hi Everyone,
    I have a query which returns a number of rows, all of which are valid. What I need to do is to get the first row for each group and work with those records.
    For example ...
    client flight startairport destairport stops
    A fl123 LGW BKK 2
    A fl124 LHR BKK 5
    B fl432 LGW XYZ 7
    B fl432 MAN ABC 8
    .... etc.
    I would need to return one row for Client A and one row for Client B (etc.) but find that I can't use the MIN function because it would return the MIN value for each column (i.e. mix up the rows). I also can use the rownum=1 because this would only return one row rather than one row per group (i.e. per client).
    I have been investigating and most postings seem to say that it needs a second query to look up the first row for each grouping. This is a solution which would not really be practical because my query is already quite complex and incorporating duplicate subqueries would just make the whole thing much to cumbersome.
    So what I really new is a "MIN by group" or a "TOP by group" or a "ROWNUM=1 by group" function.
    Can anyone help me with this? I'm sure that there must be a command to handle this.
    Regards and any thanks,
    Alan Searle
    Cologne, Germany

    Something like this:
    select *
    from (
       select table1.*
       row_number() over (partition by col1, col2 order by col3, col4) rn
       from table1
    where rn = 1In the "partition by" clause you place what you normally would "group by".
    In the "order by" clause you define which will have row_number = 1.
    Edit:
    PS. The [url http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/functions004.htm#i81407]docs have more examples on using analytical functions ;-)
    Edited by: Kim Berg Hansen on Sep 16, 2011 10:46 AM

  • SQL Query to find missed nunmber from each group

    Hi,
    I have a set of records called "Level" and its values are A, B, C, D.
    From the below list, I want to identify the missed level for each group.
    ID          Level          Type
    1             A               Floor
    1             B                Floor
    2             A               Wind           
    2             C                Wind
    I need result like: [Missed level records]
    ID          Level          Type
    1               C             NULL     1- doesnt has C and D
    1               D             NULL
    2               B             NULL      2- doesnt has A and C
    2               D             NULL
    Pls suggest.
    Regards,
    -Sugumar Pannerselvam

    Hi,
    Got output with below code. may helpful for others.
    DECLARE @TblLevel TABLE(Level VARCHAR(10))
    INSERT INTO @TblLevel(Level) VALUES('A'),('B'),('C'),('D')
    DECLARE @TblRecords TABLE(ID INT, Level CHAR(1), Type VARCHAR(10))
    INSERT INTO @TblRecords(ID, Level, Type) VALUES(1,'A','Floor'),(1,'B','Floor'),(2,'A','Wind'),(2,'C','Wind')
    DECLARE @TblResult TABLE(ID INT, Level CHAR(1), Type VARCHAR(10))
    INSERT INTO @TblResult(ID, Level, Type)
    SELECT DISTINCT ID, TblLevel.Level, Type
    FROM @TblRecords TblRec
    CROSS JOIN @TblLevel TblLevel
    SELECT TblResult.* FROM @TblResult TblResult
    LEFT OUTER JOIN @TblRecords TblRec ON TblResult.ID = TblRec.ID AND TblResult.Level = TblRec.Level
    WHERE TblRec.Level IS NULL
    ORDER BY 1
    Looking for some best way to achieve this. As of now considered this as answer. :-)
    Regards,
    Sugumar Pannerselvam.

  • Last() not returning correct value within for-each-group

    I've found inconsistent results between JDeveloper and SOA Suite using the xslt 2.0 for-each-group construct.
    <xsl:for-each-group select="Po/PoLine" group-by="itemId">
    <xsl:if test="position()=1">
    <GroupCount>
    <xsl:value-of select="last()"/>
    </GroupCount>
    </xsl:if>
    </xsl:for-each-group>
    What I expect is the function last() to give me the number of groups which is the unique number of itemIds.
    In JDeveloper 10.1.3.4, testing this construct gives me what I expect.
    At run-time (deployed to 10.1.3.3 SOA Suite), the value returned is the total number of records, not the number of groups.
    For example, given the following XML
    <Po>
    <PoLine>
    &lt;itemId&gt;<strong>001</strong>&lt;/itemId&gt;
    &lt;description&gt;Hammer&lt;/description&gt;
    &lt;quantity&gt;10&lt;/quantity&gt;
    &lt;/PoLine&gt;
    &lt;PoLine&gt;
    &lt;itemId&gt;<strong>001</strong>&lt;/itemId&gt;
    &lt;description&gt;Hammer&lt;/description&gt;
    &lt;quantity&gt;10&lt;/quantity&gt;
    &lt;/PoLine&gt;
    &lt;PoLine&gt;
    &lt;itemId&gt;<strong>002</strong>&lt;/itemId&gt;
    &lt;description&gt;Nail&lt;/description&gt;
    &lt;quantity&gt;10&lt;/quantity&gt;
    &lt;/PoLine&gt;
    &lt;/Po&gt;
    Grouping by <strong>itemId</strong>, last() should return 2 as there are two groups (001 and 002). JDeveloper does this.
    When deployed to SOA Suite, last() returns 3.
    Any ideas?

    Hi,
    if JDeveloper is doing the right thing then this issue should be reported to the SOA Suite forum or BPEL BPEL , what do you think ?
    Frank

  • Dynamically group records by date

    I am attempting to create a report that will dynamically group records into a set number of date buckets.  This is similar to grouping records by a date field and setting the days, weeks, months, etc property but instead of grouping by a set time span I want to a specific number of date groups regardless of date span.  So say i have records where the first date is today at 1am and the last record is today at 9 pm.  I want the data grouped into 10 groups and the time calculated for that group based on total time span / 10.  The first group would be 1AM to 3AM, the second would group 3AM to 5AM, etc..  The reason I am doing this is for a chart that displays record counts over time but the overall timespan will never be known until runtime.  Setting the chart for hourly or weekly doesn't work because if the user runs the report over a year the dates will be illegible.
    Thanks in advance!

    Well this SHOULD be easy. But leave it to CR make not...
    You can start by finding the minimum & maximum dates within your range:
    Local DateTimeVar MinDate;
    MinDate := Minimum({Table.DateField})
    and
    Local DateTimeVar MaxDate;
    MaxDate := Maximum({Person.ModifiedDate})
    Then figure out what the the interval would be if the span is broken down into 10 equal parts"
    DateDiff("n", {@MinDate}, {@MaxDate}) / 10
    From there just use a formula to segregate each records into the appropriate groups:
    EvaluateAfter({@Interval});
    IF {Table.DateField} >= {@MinDate}
        AND {Table.DateField} <= DateAdd("n",{@Interval}, {@MinDate}) THEN 1 ELSE
    IF {Table.DateField} > DateAdd("n",{@Interval}, {@MinDate})
        AND {Table.DateField} <= DateAdd("n",{@Interval} * 2, {@MinDate}) THEN 2 ELSE
    IF {Table.DateField} > DateAdd("n",{@Interval} * 2, {@MinDate})
        AND {Table.DateField} <= DateAdd("n",{@Interval} * 3, {@MinDate}) THEN 3 ELSE
    IF{Table.DateField} > DateAdd("n",{@Interval} * 3, {@MinDate})
        AND{Table.DateField} <= DateAdd("n",{@Interval} * 4, {@MinDate}) THEN 4 ELSE
    IF {Table.DateField} > DateAdd("n",{@Interval} * 4, {@MinDate})
        AND {Table.DateField} <= DateAdd("n",{@Interval} * 5, {@MinDate}) THEN 5 ELSE
    IF {Table.DateField} > DateAdd("n",{@Interval} * 5, {@MinDate})
        AND {Table.DateField} <= DateAdd("n",{@Interval} * 6, {@MinDate}) THEN 6 ELSE
    IF {Table.DateField} > DateAdd("n",{@Interval} * 6, {@MinDate})
        AND {Table.DateField} <= DateAdd("n",{@Interval} * 7, {@MinDate}) THEN 7 ELSE
    IF {Table.DateField} > DateAdd("n",{@Interval} * 7, {@MinDate})
        AND{Table.DateField} <= DateAdd("n",{@Interval} * 8, {@MinDate}) THEN 8 ELSE
    IF {Table.DateField} > DateAdd("n",{@Interval} * 8, {@MinDate})
        AND {Table.DateField} <= DateAdd("n",{@Interval} * 9, {@MinDate}) THEN 9 ELSE
    IF {Table.DateField} > DateAdd("n",{@Interval} * 9, {@MinDate})
        AND {Table.DateField}  <= {@MaxDate} THEN 10
    This is where CR drops the ball... IMHO... it WON'T allow you to to group by a formula field that uses an aggregate in the formula (in this case Minimum & Maximum)... It will however allow to to graph on it, which I assume is what you are actually trying to do.  If anyone knows a way to work around the grouping issue, I'd love to know it myself.
    HTH,
    Jason

  • Reset Page Number for each Group

    I am currently creating a RTF template using XMLP 5.0
    My demanding boss gets back in town in five days, and he expects
    this report to be ready for production. :)
    But I haven't been able to figure out one last spec.
    The page number needs to be reset for each group.
    So for example, the total report is about 83 pages.
    In my RDF file (from Oracle Apps), I am grouping by a DEPT field.
    In my RTF template, I am page breaking on each DEPT.
    The page numbering should also be reset to 1 on each DEPT break.
    The reason for this, is that the report will be printed, then separated by DEPT.
    This way, each DEPT in the plant can receive their own individual report.
    Is there anyway to do this using XMLP 5.0?
    We would be willing to upgrade our XMLP,
    if this functionality is available in a later version.
    Thanks in advance.
    Mark K

    Hi Mark
    Yep, you can do this, you can even do it in 5.0 :o)
    For some reason it did not make the user doc in 5.0 ... an Easter egg if you like.
    So I'd recommend getting the 5.5 or later docs and using that for reference. Just search for "About Oracle XML Publisher Release 5.5" on metalink once you have that doc search it for "Oracle XML Publisher User's Guide" its a link to the PDF document.
    Then check pg 86/290 - Advanced Report Layouts > Batch Reports for details. This approach will work for 5.5. If you would like a sample then if you have installed the template builder there is an Advanced > Repeating Headers folder inwhich you will find an example.
    Regards, Tim

  • How to "group by" and use functions on grouped records

    I group rows and wantto select the max date row in date column. The other columns can include same data in its rows, thus i wantto select distinct data in the rows. I use the following query, but ir throws the message "ORA-00936: missing expression."
    select max(t2.tarih), distinct (t1.ihlkodu),distinct(t1.ihlaltktgkodu), distinct(t1.kuladi),distinct(t4.ad) from ihale_katilimcilar t1, ihale_hareket t2, ihale_sirket t4
    where t1.id_iliski=t2.id_iliski and t1.kuladi=t4.kullaniciadi and t1.ihlkodu=145 and t1.ihlaltktgkodu=135 and t1.aktif=1
    group by t2.tarih, t1.ihlkodu,t1.ihlaltktgkodu,t1.kuladi,t4.ad
    Here t2.tarih is a field of date and i wantto select the max of this.
    t1.ihlkodu has all the same data in its rows.
    t1.ihlaltktgkodu too has all the same data in its rows.
    t1.kuladi may have ,let me say, 5 rows of same data and 6 rows of another same data in this 6 but different then the first 5 rows of same data. That is, the content of the 6 and 5 is the same in 6 and 5 but different then each other.
    and finally[b] t4.ad too may have ,let me say, 5 rows of same data and 6 rows of another same data in this 6 but different then the first 5 rows of same data.(That is, the content of the 6 and 5 is the same in 6 and 5 but different then each other)
    How could i group them?

    Here is the script of tables:
    -- Create table
    create table IHALE_SIRKET
    SRKTKODU NUMBER not null,
    AD VARCHAR2(30) not null,
    ADRES VARCHAR2(50),
    TEL1 VARCHAR2(15),
    TEL2 VARCHAR2(15),
    FAX VARCHAR2(15),
    EMAIL VARCHAR2(20),
    KARALISTE NUMBER default -1,
    AKTIF NUMBER(1) default -1,
    SICILNO VARCHAR2(20) not null,
    VERGINO VARCHAR2(20) not null,
    TICSICILGAZSAYI VARCHAR2(10) not null,
    TICSICILGAZTARIH DATE not null,
    ODASICILNO VARCHAR2(20),
    TESCILTARIHI DATE,
    SERMAYE VARCHAR2(20),
    DERECE NUMBER(2),
    ODAKAYITTARIHI DATE,
    KULLANICIADI VARCHAR2(15)
    tablespace USERS
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    initial 64K
    minextents 1
    maxextents unlimited
    -- Create/Recreate primary, unique and foreign key constraints
    alter table IHALE_SIRKET
    add constraint CONSTRAINT_SRKTKODUPK primary key (SRKTKODU);
    -- Create/Recreate indexes
    create unique index IHALE_SIRKET_SRKTKODU on IHALE_SIRKET (SRKTKODU)
    tablespace USERS
    pctfree 10
    initrans 2
    maxtrans 255
    storage
    initial 64K
    minextents 1
    maxextents unlimited
    -- Create table
    create table IHALE_KATILIMCILAR
    KULADI VARCHAR2(20),
    SONUC NUMBER(1),
    AKTIF NUMBER(1) default 1,
    SRKTKODU VARCHAR2(10) not null,
    SONBULUNMAZAMANI DATE default sysdate,
    SIRA NUMBER(1) default 0,
    EKSURETALEP VARCHAR2(50),
    ID NUMBER(6) not null,
    IHLKODU NUMBER not null,
    IHLALTKTGKODU VARCHAR2(10) not null,
    ID_ILISKI NUMBER
    tablespace USERS
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    initial 64K
    minextents 1
    maxextents unlimited
    -- Create/Recreate primary, unique and foreign key constraints
    alter table IHALE_KATILIMCILAR
    add constraint CONSTRAINT_IHLKTLMIDPK primary key (ID)
    using index
    tablespace USERS
    pctfree 10
    initrans 2
    maxtrans 255
    storage
    initial 64K
    minextents 1
    maxextents unlimited
    -- -- -- Create table
    create table IHALE_HAREKET
    ID_ILISKI NUMBER not null,
    TEKLIF VARCHAR2(15) not null,
    TARIH DATE default sysdate,
    ID NUMBER not null
    tablespace USERS
    pctfree 10
    initrans 1
    maxtrans 255
    storage
    initial 64K
    minextents 1
    maxextents unlimited
    -- Create/Recreate primary, unique and foreign key constraints
    alter table IHALE_HAREKET
    add constraint CONSTRAINT_IHLHAREKETPK primary key (ID)
    using index
    tablespace USERS
    pctfree 10
    initrans 2
    maxtrans 255
    storage
    initial 64K
    minextents 1
    maxextents unlimited
    Here is the content of those tables:
    prompt Loading IHALE_HAREKET...
    insert into IHALE_HAREKET (ID_ILISKI, TEKLIF, TARIH, ID)
    values (189, '1400YTL', to_date('12-02-2008 14:35:07', 'dd-mm-yyyy hh24:mi:ss'), 1);
    insert into IHALE_HAREKET (ID_ILISKI, TEKLIF, TARIH, ID)
    values (203, '1200YTL', to_date('12-02-2008 16:03:16', 'dd-mm-yyyy hh24:mi:ss'), 2);
    insert into IHALE_HAREKET (ID_ILISKI, TEKLIF, TARIH, ID)
    values (203, '1100YTL', to_date('12-02-2008 16:03:16', 'dd-mm-yyyy hh24:mi:ss'), 3);
    insert into IHALE_HAREKET (ID_ILISKI, TEKLIF, TARIH, ID)
    values (189, '1500 YTL', to_date('12-02-2008 14:34:30', 'dd-mm-yyyy hh24:mi:ss'), 0);
    prompt 4 records loaded
    prompt Loading IHALE_KATILIMCILAR...
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, EKSURETALEP, ID, IHLKODU, IHLALTKTGKODU, ID_ILISKI)
    values (null, null, 0, '42', to_date('12-02-2008 13:33:32', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 63, 141, '134', 191);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, EKSURETALEP, ID, IHLKODU, IHLALTKTGKODU, ID_ILISKI)
    values (null, null, 0, '46', to_date('12-02-2008 13:33:32', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 64, 141, '134', 192);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, EKSURETALEP, ID, IHLKODU, IHLALTKTGKODU, ID_ILISKI)
    values ('KEM.ESM', null, 1, '44', to_date('12-02-2008 11:00:41', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 61, 145, '135', 189);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, EKSURETALEP, ID, IHLKODU, IHLALTKTGKODU, ID_ILISKI)
    values (null, null, 0, '45', to_date('12-02-2008 13:33:42', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 69, 141, '133', 197);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, EKSURETALEP, ID, IHLKODU, IHLALTKTGKODU, ID_ILISKI)
    values (null, null, 0, '42', to_date('12-02-2008 13:33:36', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 65, 141, '132', 193);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, EKSURETALEP, ID, IHLKODU, IHLALTKTGKODU, ID_ILISKI)
    values (null, null, 0, '45', to_date('12-02-2008 13:33:36', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 66, 141, '132', 194);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, EKSURETALEP, ID, IHLKODU, IHLALTKTGKODU, ID_ILISKI)
    values (null, null, 0, '46', to_date('12-02-2008 13:33:36', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 67, 141, '132', 195);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, EKSURETALEP, ID, IHLKODU, IHLALTKTGKODU, ID_ILISKI)
    values (null, null, 0, '42', to_date('12-02-2008 13:33:42', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 68, 141, '133', 196);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, EKSURETALEP, ID, IHLKODU, IHLALTKTGKODU, ID_ILISKI)
    values (null, null, 0, '44', to_date('12-02-2008 13:34:23', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 70, 142, '252', 198);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, EKSURETALEP, ID, IHLKODU, IHLALTKTGKODU, ID_ILISKI)
    values (null, null, 0, '45', to_date('12-02-2008 13:34:23', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 71, 142, '252', 199);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, EKSURETALEP, ID, IHLKODU, IHLALTKTGKODU, ID_ILISKI)
    values (null, null, 0, '44', to_date('12-02-2008 13:34:40', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 72, 143, '253', 200);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, EKSURETALEP, ID, IHLKODU, IHLALTKTGKODU, ID_ILISKI)
    values (null, null, 0, '46', to_date('12-02-2008 13:34:40', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 73, 143, '253', 201);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, EKSURETALEP, ID, IHLKODU, IHLALTKTGKODU, ID_ILISKI)
    values (null, null, 0, '45', to_date('12-02-2008 11:00:38', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 60, 145, '136', 188);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, EKSURETALEP, ID, IHLKODU, IHLALTKTGKODU, ID_ILISKI)
    values (null, null, 0, '44', to_date('12-02-2008 15:59:21', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 74, 145, '136', 202);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, EKSURETALEP, ID, IHLKODU, IHLALTKTGKODU, ID_ILISKI)
    values ('KE.ES', null, 1, '45', to_date('12-02-2008 15:59:25', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 75, 145, '135', 203);
    commit;
    prompt 15 records loaded
    prompt Loading IHALE_SIRKET...
    insert into IHALE_SIRKET (SRKTKODU, AD, ADRES, TEL1, TEL2, FAX, EMAIL, KARALISTE, AKTIF, SICILNO, VERGINO, TICSICILGAZSAYI, TICSICILGAZTARIH, ODASICILNO, TESCILTARIHI, SERMAYE, DERECE, ODAKAYITTARIHI, KULLANICIADI)
    values (42, 'KEMMM', 'asddd', '03123456444', '03123456444', '03123456444', '[email protected]', 0, 1, '325999444', '234999444', '34599944', to_date('04-02-2008', 'dd-mm-yyyy'), '23/29444', to_date('04-02-2008', 'dd-mm-yyyy'), '4.000.000.11YTL', 1, to_date('04-02-2008', 'dd-mm-yyyy'), null);
    insert into IHALE_SIRKET (SRKTKODU, AD, ADRES, TEL1, TEL2, FAX, EMAIL, KARALISTE, AKTIF, SICILNO, VERGINO, TICSICILGAZSAYI, TICSICILGAZTARIH, ODASICILNO, TESCILTARIHI, SERMAYE, DERECE, ODAKAYITTARIHI, KULLANICIADI)
    values (46, 'MLK', 'fgh', '456', '456', '456', '[email protected]', 0, 1, '2346', '2346', '2346', to_date('27-01-2008', 'dd-mm-yyyy'), '2346', to_date('25-01-2008', 'dd-mm-yyyy'), '2346', 1, to_date('22-01-2008', 'dd-mm-yyyy'), null);
    insert into IHALE_SIRKET (SRKTKODU, AD, ADRES, TEL1, TEL2, FAX, EMAIL, KARALISTE, AKTIF, SICILNO, VERGINO, TICSICILGAZSAYI, TICSICILGAZTARIH, ODASICILNO, TESCILTARIHI, SERMAYE, DERECE, ODAKAYITTARIHI, KULLANICIADI)
    values (44, 'ASD', 'asd', '123', '123', '123', '[email protected]', 0, 1, '123', '123', '123', to_date('10-01-2008', 'dd-mm-yyyy'), '123', to_date('17-01-2008', 'dd-mm-yyyy'), '123', 1, to_date('11-01-2008', 'dd-mm-yyyy'), 'KEM.ESM');
    insert into IHALE_SIRKET (SRKTKODU, AD, ADRES, TEL1, TEL2, FAX, EMAIL, KARALISTE, AKTIF, SICILNO, VERGINO, TICSICILGAZSAYI, TICSICILGAZTARIH, ODASICILNO, TESCILTARIHI, SERMAYE, DERECE, ODAKAYITTARIHI, KULLANICIADI)
    values (45, 'JKL', 'jkl', '234', '234', '345', '[email protected]', 0, 1, '234', '234', '234', to_date('04-01-2008', 'dd-mm-yyyy'), '234', to_date('27-01-2008', 'dd-mm-yyyy'), '234', 2, to_date('19-01-2008', 'dd-mm-yyyy'), 'KE.ES');
    When i use the following sql:
    select t2.teklif, t2.tarih, t1.ihlkodu, t1.ihlaltktgkodu, t1.kuladi,t4.ad from ihale_katilimcilar t1, ihale_hareket t2, ihale_sirket t4
    where t1.id_iliski=t2.id_iliski and t1.kuladi=t4.kullaniciadi and t1.ihlkodu=145 and t1.ihlaltktgkodu=135 and t1.aktif=1
    group by t2.teklif, t2.tarih, t1.ihlkodu,t1.ihlaltktgkodu,t1.kuladi,t4.ad
    The result i get is:
    1100YTL 12.02.2008 16:08:16 145 135 KE.ES JKL ***
    1200YTL 12.02.2008 16:03:16 145 135 KE.ES JKL
    1400YTL 12.02.2008 14:35:07 145 135 KEM.ESM ASD ***
    1500 YTL 12.02.2008 14:34:30 145 135 KEM.ESM ASD
    The one i wantto get is the rows of the latest date in each group:
    1100YTL 12.02.2008 16:08:16 145 135 KE.ES JKL [b]***
    1400YTL 12.02.2008 14:35:07 145 135 KEM.ESM ASD ***
    max date -->latest date , most up to date
    Message was edited by:
    user611878
    Message was edited by:
    kem06.ora

  • Grouping records by month

    Hi,
    I have a group of records in the XML structure as below:
    <ListofIO>
    <ListOfBipReport1>
    <Report>
    <FirstName/>
    <LastName/>
    <Planned>04/12/2011</Planned>
    </Report>
    <Report>
    <FirstName/>
    <LastName/>
    <Planned>04/10/2011</Planned>
    </Report>
    <Report>
    <FirstName/>
    <LastName/>
    <Planned>05/08/2011</Planned>
    </Report>
    </ListOfBipReport1>
    </ListofIO>
    I would like to group the records by month based on the Planned date.
    I used the following code: <?for-each-group:Report;./Planned?><?sort:current-group()/Planned;'ascending';data-type='text'?>
    and I formatted the Planned date to display in the format mmm-yy
    I would like the report to display info as follows:
    Apr-11
    First Name
    Last Name
    First Name
    Last Name
    May -11
    First Name
    Last Name
    but when I run the report what I see is the following:
    Apr-11
    First Name
    Last Name
    Apr-11
    First Name
    Last Name
    May-11
    First Name
    Last Name
    i.e. The grouping is displaying for every record
    How do I group the Planned dates for each record together so that I see each month listed only once?
    thanks

    Your date needs to be in the canonical format to apply any formatting.
    You could use the substring function and concat function to extract the month and year and then use that to group by.. not the best way..
    Thanks,
    Bipuser

  • Can i make a sequence to create a record number for each new record

    Does anybody know if a field can be inserted to or a feature turned on to create a automatic numbering system for each incoming record

    It's easier if you don't. You can do what you want using a template, but it will require some scripting. It's also easier to do than describe, but I'll try. Begin by creating the fields on a page in the locations you want, insert this page to the document, as the first page for example. You can then replace it with a blank page, which will leave the form fields behind. Then make this page a template and hide it. You can then run a script from the interactive JavaScript console that spawns the hidden template on the first page as an overlay, extracts the page that now has fields as a new document, and repeat for the rest of the pages. Here are links to documentation of some of the scripting that will be involved:
    template.spawn: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.1216.html
    doc.extractPages: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.465.html
    The process for making a page a template through Acrobat's UI depends on what version you're using, but it can be doen programmatically too: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.451.html

  • ReportViewer Total column InScope causes repeating values in Innermost group

    I have a table which has only one cell. Inside that cell it has a rectangle (design purposes only) and inside that rectangle there is my main table. Primary table is used for paging, so it has one group. Innermost table is for data view. The problem is,
    that if i have ANY expression containing InScope("Matrix1_Group1") in Total column in the innermost table, i get repeating values in that table. Numbers are ok, but rows titles are repeating.
    +-----------+------------+---------+----------+
    | Country | Producer | [Month] | Total |
    +-----------+------------+---------+----------+
    | [Country] | [Producer] | SUM(Q) | <<Expr>> |
    +-----------+------------+---------+----------+
    | Total | SUM(Q) | <<Expr>> |
    +------------------------+---------+----------+
    This is the sample of my innermost table (tried my best. not allowed to insert images). I i use InScope("Matrix1_Group1") in ANY (value, Color, BackgroundColor) expression in Total column, Producer column values are repeating (the first value
    is repeated in all rows).
    Sample expression from cell in Total column is: =IIF(InScope("Matrix1_Group1"), Fields!Producer.Value/SUM(Fields!Producer.Value, "Matrix1_Group1"), "100%")
    More information abou this problem.
    It only occurs if two conditions are met: repor has paging and InScope returns true. I have to make pages in report and each page contains table and some other blocks. I use List component to create a list and use grouping. Then i put a table inside. If
    table is outside any element, everything works perfectly, but if it is inside list, table, matrix or something similar allowing to create pages, the problem occurs. 
    Also, if InScope allways returns FALSE and none condition is met - there is no problem. But if any InScope return TRUE - i have repeating values in innermost group.

    Please have a look at the following links:
    http://download-west.oracle.com/docs/html/B10602_01/orbr_summary.htm#1010648
    http://download-west.oracle.com/docs/html/B10602_01/toc.htm

  • Query to find the latest two transactions for each Group

    Hi All,
    Consider the following sets of records in a table test.
    Group---Tran_Dt---SlNo
    c1 10/10/2003 1
    c1 10/10/2003 2
    c1 10/10/2003 3
    c1 11/10/2003 1
    c2 10/10/2003 1
    c2 10/10/2003 2
    c2 11/10/2003 1
    c2 11/10/2003 2
    c2 11/10/2003 3
    c3 10/10/2003 1
    c3 10/10/2003 2
    c3 10/10/2003 3
    I want to list out the latest two transactions for each group irrespective of the slno and trans_dt as below:
    group tran_dt SlNo
    c1 11/10/2003 1
    c1 10/10/2003 3
    c2 11/10/2003 3
    c2 11/10/2003 2
    c3 10/10/2003 3
    c3 10/10/2003 2
    Any help on this would be appreciated.
    Thanks
    Walter Nicholas T

    Hi Walter,
    Please try following query.
    select Group,tran_dt,sino from
    select Group,tran_dt,sino,(DENSE_RANK()OVER (PARTITION BY Group ORDER BY tran_dt desc,sino desc)) rank from test
    ) where rank between 1 and 2
    Thanks,
    Samir

  • Separate Header, Main, Trailer for each group of date

    Hi,
    I have report built-in Oracle Reports10g R2, with Header, Main, Trailer sections, I am running report for different date parameters, for instance date between 29-30 Dec, 11.
    But when i get output of the report it do format as I expect, mean output comes in this way Header(29, 30 Dec), Main(29, 30 Dec), Trailer(29, 30). I made separate repeating frame for all of 3 sections which is based on DATE parameter. I want output to be Header(29 Dec), Main(29 Dec), Trailer(29) and same for 30th Dec.
    Somebody will guide me please what is wrong with my report.
    Thanks and Regards,
    Syed Khawar
    Edited by: S.Khawar on Jan 4, 2012 11:44 AM

    Hi bombocha,
    According to your description, you want to export each group to separate Excel File. As tested in my environment, we can use filter and subscription to achieve your goal. Please refer to the following steps:
    Supposing we have a table grouping on SalesTerritoryGroup field, we can create another dataset Dataset2 using the simple queries "Select distinct SalesTerritoryGroup from ...".
    Add a parameter @SalesTerritoryGroup to the report, then get Available Values from Dataset2 SalesTerritoryGroup field.
    Create a filter on the dataset used to extract report data, set Expression: SalesTerritoryGroup, Operator: =, Value: [@SalesTerritoryGroup].
    Deploy the report to report manager and create a data-driven subscription with Windows File Share delivery extension.
    In step 3 of creating the subscription, specify the query as "Select distinct  SalesTerritoryGroup  from ..." and click on Validate button.
    In step 4, set file name as Get the value from the database: SalesTerritoryGroup, and set Render Format to Excel.
    In step 5, as to the SalesTerritoryGroup parameter values, select SalesTerritoryGroup from Get the value from the database drop down list.
    Create a schedule for the subscription, then click Finish.
    For more information about Data-driven Subscriptions, please refer to the following article:
    Data-driven Subscriptions in SSRS
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu

  • Variables + for each group + xml publisher

    Hi All,
    My requirement: one group is repeating many times, but based on one data in that group i need to display it.
    Ex:
    <GROUP>
    <DATE>23-July-2007</DATE>
    <DESC>Testing1</DESC>
    </GROUP><GROUP>
    <DATE>10-Aug-2008</DATE>
    <DESC>Testing2</DESC>
    </GROUP><GROUP>
    <DATE>10-Aug-2008</DATE>
    <DESC>Testing2</DESC>
    </GROUP><GROUP>
    <DATE>23-July-2007</DATE>
    <DESC>Testing1</DESC>
    </GROUP>
    In the above exapmle if u see the date xml tag holds 2 different dates which is same (repeating twice). But while displaying i need to show that only once.
    Means.. 23-July-2007 - 1 time and 10-Aug-2008 - 1 time instead of twice.
    I tried through using variables. getting the first date in that variable and checking with others. But not able to compare those..... (No idea)
    How can we achieve that. Please someone help me in this ASAP.
    Thanks in Advance,
    Vinoth

    Shanmu, thanks for responding -- I think I may have actually figured this out. I believe I had a trailing "/" on my "select" on the for-each-group that wasn't supposed to be there. I've reviewed this stuff so many times my eyes are crossed -- but this time I saw it. I've done some additional testing and it appears to be working properly, although I'm going to be extending the functionality now to include a nested for-each-group so we'll see how that goes.
    I'm marking this one as answered for now as it does appear to be working as expected.
    Thanks!!

Maybe you are looking for

  • Job scheduling

    Hi Friends,          i have a problem with job scheduling. two jobs need to be scheduled. (job1 and job2) i used job_open. submit job1 using parameters. job_close. then for second job. job_open. submit job2 using parameter2. job_close. when i go and

  • Error installing iTunes 11.1.2.31

    While installing the latest version of iTunes (11.1.2.31) on Windows 7, I get a permissions error. The installer claims it doesn't have permission to access the x86 directory for iTunes, so it can't install. It asks me to sign in as Administrator, bu

  • Several iPhones in find my iPhone

    Hello community, we have several iPhones in our office under company contract. Most people are using their own Apple ID. Is it possible to add all these iPhones to find my iPhone, so that in case it is lost, we can delete them remotely? Thanks Chris

  • Trying to simulate button click via ActionScript

    Hello, I've got code written to tell if a user is hitting his/her left or right arrow keys. I currently have a "next" button named realNext, and a "back" button named realBack. Both buttons have lots of code written in their on(release) functions. Ho

  • Expressions and Parents

    I'm trying to create an expression that takes as its input the position of a layer in an animation. However, that layer is tracked to a null which is animated, rendering the "thisComp.layer("Track").transform.position" values pretty useless because t