Duplicate row in report

hi
can any one tell me how to delete duplicate raw  from alv report  program .
Regards
rakesh

hi
the code is very helpful . I am attaching the code plz
tell me where to change the code .
*& Report  ZTAX_REPORT
REPORT  ZTAX_REPORT.
tables: bseg,rbkp.
type-pools: slis.
types: begin of ty_tab,
        belnr type bseg-belnr,
        gjahr type bseg-gjahr,
        mwskz type bseg-mwskz,
        buzid type bseg-buzid,
        text1 type t007s-text1,
        dmbtr type bseg-dmbtr,
        hkont type bseg-hkont,
        ebeln type bseg-ebeln,
        ebelp type bseg-ebelp,
        matnr type bseg-matnr,
        maktx type makt-maktx,
        name1 type lfa1-name1,
        lifnr type lfa1-lifnr,
        noninvat type bseg-dmbtr,
        werks type mseg-werks,
        awkey type bkpf-awkey,
        budat type bkpf-budat,
        totamt type bseg-dmbtr,
        invamt type bseg-dmbtr,
        taxamt type bseg-dmbtr,
       end of ty_tab.
data: begin of it_tab1 occurs 0,
        belnr type bkpf-belnr,
        gjahr type bkpf-gjahr,
       end of it_tab1.
data: begin of it_invoice occurs 0,
        belnr type rbkp-belnr,
        gjahr type rbkp-gjahr,
        budat type rbkp-budat,
        awkey type bkpf-awkey,
      end of it_invoice.
data: it_tab type table of ty_tab with header line,
      it_final type table of ty_tab with header line,
      wa_tab type ty_tab.
data: fieldcatalog type slis_t_fieldcat_alv with header line,
      gd_layout type slis_layout_alv,
      gd_repid like sy-repid.
data: tmp_dmbtr type bseg-dmbtr.
select-options: s_mwskz for bseg-mwskz obligatory no intervals,
                s_werks for bseg-werks,
                s_budat for rbkp-budat obligatory.
select belnr gjahr budat into corresponding fields of table it_invoice
                  from rbkp where budat in s_budat.
loop at it_invoice.
  concatenate it_invoice-belnr it_invoice-gjahr into it_invoice-awkey.
  modify it_invoice.
  clear it_invoice.
endloop.
select belnr gjahr into corresponding fields of table it_tab1 from bkpf
                  for all entries in it_invoice where awkey eq it_invoice-awkey.
select belnr gjahr mwskz buzid dmbtr matnr werks ebeln ebelp into corresponding
                  fields of it_tab from bseg for all entries in it_tab1
                  where belnr = it_tab1-belnr and
                        gjahr = it_tab1-gjahr and
                        mwskz in s_mwskz and
                        werks in s_werks.
  collect it_tab.
endselect.
sort it_tab by belnr gjahr.
*loop at it_tab.
wa_tab = it_tab.
collect it_tab.
*endloop.
loop at it_tab.
  if it_tab-buzid = 'W'.
  select * from bseg   where belnr = it_tab-belnr and
                        gjahr = it_tab-gjahr and
                        mwskz in s_mwskz and
                        hkont in ('0020800514','0020800515' ,'0020800516') and
                        werks in s_werks.
  tmp_dmbtr = tmp_dmbtr + bseg-dmbtr.
  clear bseg.
  endselect.
    it_tab-noninvat = tmp_dmbtr.
  clear tmp_dmbtr.
  endif.
  if it_tab-buzid = 'W'.
    it_tab-invamt = it_tab-dmbtr.
  elseif it_tab-buzid = 'T'.
    it_tab-taxamt = it_tab-dmbtr.
  endif.
  select single budat awkey from bkpf into (it_tab-budat, it_tab-awkey) where belnr = it_tab-belnr and gjahr = it_tab-gjahr.
  it_tab-belnr = it_tab-awkey.
  select single lifnr from ekko into it_tab-lifnr where ebeln = it_tab-ebeln.
  select single text1 from t007s into it_tab-text1 where spras = sy-langu and
                                                         kalsm = 'TAXINN' and
                                                         mwskz = it_tab-mwskz.
  select single maktx from makt into it_tab-maktx where matnr = it_tab-matnr.
  select single name1 from lfa1 into it_tab-name1 where lifnr = it_tab-lifnr.
  if it_tab-hkont = '0020800514' or it_tab-hkont = '0020800515' or it_tab-hkont = '0020800516'.
    it_tab-noninvat = it_tab-noninvat + it_tab-dmbtr.
  endif.
  modify it_tab.
  clear it_tab.
endloop.
loop at it_tab.
  if ( it_tab-buzid eq 'W' ).    " changes on 15/05/2008 " or it_tab-buzid eq 'P'
    read table it_tab with key belnr = it_tab-belnr gjahr = it_tab-gjahr mwskz = it_tab-mwskz buzid = 'T' into wa_tab.
    it_tab-totamt = it_tab-dmbtr + wa_tab-dmbtr.
    it_tab-taxamt = wa_tab-taxamt.
    delete it_tab where belnr = wa_tab-belnr and gjahr = wa_tab-gjahr and mwskz = wa_tab-mwskz and buzid = 'T'.
    clear wa_tab.
  endif.
  modify it_tab.
endloop.
fieldcatalog-fieldname = 'MWSKZ'.
fieldcatalog-seltext_m = 'Tax Code'.
fieldcatalog-col_pos = 1.
fieldcatalog-emphasize = 'C100'.
fieldcatalog-fix_column = 'X'.
append fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'TEXT1'.
fieldcatalog-seltext_m = 'Desc. of Tax Code'.
fieldcatalog-col_pos = 2.
fieldcatalog-emphasize = 'C100'.
fieldcatalog-fix_column = 'X'.
append fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'BELNR'.
fieldcatalog-seltext_m = 'Invoice Number'.
fieldcatalog-col_pos = 3.
fieldcatalog-emphasize = 'C100'.
fieldcatalog-fix_column = 'X'.
append fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'GJAHR'.
fieldcatalog-seltext_m = 'Invoice Year'.
fieldcatalog-col_pos = 4.
append fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'BUDAT'.
fieldcatalog-seltext_m = 'Invoice Posting Date'.
fieldcatalog-col_pos = 4.
append fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'WERKS'.
fieldcatalog-seltext_m = 'Plant'.
fieldcatalog-col_pos = 4.
append fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'LIFNR'.
fieldcatalog-seltext_m = 'Vendor No.'.
fieldcatalog-col_pos = 4.
append fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NAME1'.
fieldcatalog-seltext_m = 'Vendor Name'.
fieldcatalog-col_pos = 4.
append fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material No.'.
fieldcatalog-col_pos = 4.
append fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MAKTX'.
fieldcatalog-seltext_m = 'Material Desc.'.
fieldcatalog-col_pos = 4.
append fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'TOTAMT'.
fieldcatalog-seltext_m = 'Total Amount'.
fieldcatalog-col_pos = 4.
append fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'INVAMT'.
fieldcatalog-seltext_m = 'Inventorized Amount'.
fieldcatalog-col_pos = 4.
append fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'TAXAMT'.
fieldcatalog-seltext_m = 'Total non inventorized tax'.
fieldcatalog-col_pos = 4.
append fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NONINVAT'.
fieldcatalog-seltext_m = 'Non inventorized VAT'.
fieldcatalog-col_pos = 4.
append fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'PO Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item No'.
fieldcatalog-col_pos = 4.
append fieldcatalog.
clear fieldcatalog.
gd_layout-zebra = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-info_fieldname = 'COLOR'.
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
    I_INTERFACE_CHECK                 = ' '
    I_BYPASSING_BUFFER                = ' '
    I_BUFFER_ACTIVE                   = ' '
   I_CALLBACK_PROGRAM                = gd_repid
    I_CALLBACK_PF_STATUS_SET          = ' '
    I_CALLBACK_USER_COMMAND           = ' '
    I_CALLBACK_TOP_OF_PAGE            = ' '
    i_callback_top_of_page         = 'TOP-OF-PAGE'
    I_CALLBACK_HTML_END_OF_LIST       = ' '
    I_STRUCTURE_NAME                  =
    I_BACKGROUND_ID                   = ' '
    I_GRID_TITLE                      =
    I_GRID_SETTINGS                   =
   IS_LAYOUT                         = gd_layout
   IT_FIELDCAT                       = fieldcatalog[]
    IT_EXCLUDING                      =
    IT_SPECIAL_GROUPS                 =
    IT_SORT                           =
    IT_FILTER                         =
    IS_SEL_HIDE                       =
    I_DEFAULT                         = 'A'
     I_SAVE                            = 'A'
    IS_VARIANT                        =
    IT_EVENTS                         =
    IT_EVENT_EXIT                     =
    IS_PRINT                          =
    IS_REPREP_ID                      =
    I_SCREEN_START_COLUMN             = 0
    I_SCREEN_START_LINE               = 0
    I_SCREEN_END_COLUMN               = 0
    I_SCREEN_END_LINE                 = 0
    I_HTML_HEIGHT_TOP                 = 0
    I_HTML_HEIGHT_END                 = 0
    IT_ALV_GRAPHICS                   =
    IT_HYPERLINK                      =
    IT_ADD_FIELDCAT                   =
    IT_EXCEPT_QINFO                   =
    IR_SALV_FULLSCREEN_ADAPTER        =
  IMPORTING
    E_EXIT_CAUSED_BY_CALLER           =
    ES_EXIT_CAUSED_BY_USER            =
  TABLES
    T_OUTTAB                          = it_tab
  EXCEPTIONS
    PROGRAM_ERROR                     = 1
    OTHERS                            = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Similar Messages

  • How to Not Display Exact Duplicate Rows in Report

    I have a report that displays many duplicate rows where all fields in several rows are exact duplicates.  I would like to know how to make it so that the entire row does not show up if it is an exact duplicate of another row.  Any ideas?  Thanks.

    I literally have been pulling my hair out for the past 3 days with the same issue.  I'm new to SSRS.  I created a new report where I basically only wanted to show order header info, but unfortunately, some of the info I need to show at the header
    level is only kept at the detail level.  So, when I linked the order header to the order detail (one to many) I got a duplicate row for every line that was in the order detail.   I tried to group just by order number (thinking it would roll
    all the dups up) but that didn't work.  Doing a group on all the fields on the report did the trick.
    I owe Mainiac007 a beer!!!! :)

  • Crystal report duplicate row problem

    Hi expert,
    Need help about crystal report for my customer, want to make report about outgoing payment(OVPM) but it become duplicate row for detail because 1 payment include lot cheque(VPM1) more than 1,i just want to know if there got other method to avoid duplicate row.I also try put formula for detail area "{VPM1.CheckAct} = Next({VPM1.CheckAct})" or "{VPM1.CheckAct} = previous({VPM1.CheckAct})"..it useful for 1 row only,if i put more row,it will eliminate other row,just show 1 row.
    Here is my query take from crystal report.
    SELECT 
    "OVPM"."DocTotal", "OVPM"."DocNum", "OVPM"."DocDate",
    "NNM1"."SeriesName", "OVPM"."Address", "OVPM"."DocCurr", "VPM1"."CheckNum",
    "VPM4"."AcctCode", "OVPM"."CheckAcct", "OACT_1"."AcctName", "OACT_2"."AcctName",
      "VPM4"."Descrip", "OVPM"."Comments", "OVPM"."NoDocSum", "OVPM"."DocType", "VPM2"."DocEntry",
       "VPM2"."SumApplied", "OPCH"."DocDate", "VPM2"."InvType", "OCRD"."Phone1", "OCRD"."Fax",
        "OCRD"."CntctPrsn", "VPM2"."DocNum", "VPM1"."BankCode", "OVPM"."CardName", "OVPM"."CardCode",
         "VPM1"."CheckAct", "OACT_3"."AcctName", "VPM1"."CheckSum", "VPM1"."LineID", "VPM4"."OcrCode",
          "OVPM"."CounterRef", "OVPM"."TrsfrAcct", "OACT_4"."AcctName", "OVPM"."TrsfrSum",
           "OVPM"."PayToCode", "OVPM"."JrnlMemo", "VPM4"."SumApplied", "OVPM"."CashAcct", "VPM1"."U_Ref"
    FROM  
    "OVPM" "OVPM"
    LEFT OUTER JOIN "VPM2" "VPM2" ON "OVPM"."DocNum"="VPM2"."DocNum"
    LEFT OUTER JOIN "NNM1" "NNM1" ON "OVPM"."Series"="NNM1"."Series"
    LEFT outer JOIN "VPM1" "VPM1" ON "OVPM"."Docentry"="VPM1"."DocNum"
    LEFT OUTER JOIN "VPM4" "VPM4" ON "OVPM"."DocNum"="VPM4"."DocNum"
    LEFT OUTER JOIN "OACT" "OACT_2" ON "OVPM"."CheckAcct"="OACT_2"."AcctCode"
    LEFT OUTER JOIN "OCRD" "OCRD" ON "OVPM"."CardCode"="OCRD"."CardCode"
    LEFT OUTER JOIN "OACT" "OACT_4" ON "OVPM"."TrsfrAcct"="OACT_4"."AcctCode"
    LEFT OUTER JOIN "OACT" "OACT_3" ON "VPM1"."CheckAct"="OACT_3"."AcctCode"
    LEFT OUTER JOIN "OACT" "OACT_1" ON "VPM4"."AcctCode"="OACT_1"."AcctCode"
    LEFT OUTER JOIN "OPCH" "OPCH" ON "VPM2"."DocEntry"="OPCH"."DocEntry"
    WHERE  "OVPM"."DocNum"=9005070
    ORDER BY "OVPM"."DocNum", "VPM1"."LineID"

    Hi,
    Change LEFT outer JOIN "VPM1" "VPM1" ON "OVPM"."Docentry"="VPM1"."DocNum"
    to: LEFT JOIN "VPM1" "VPM1" ON "OVPM"."DoceNum"="VPM1"."DocNum"
    Remove: LEFT OUTER JOIN "OACT" "OACT_3" ON "VPM1"."CheckAct"="OACT_3"."AcctCode"
    Thanks,
    Gordon

  • Report Generates Duplicate Rows

    Each,
    I have a report which when generated and run as 9i report on Linux generates duplicate rows. Whereas the same report running on 6i client server works perfectly fine. Running against the exact same database.
    The report generates a delimited CSV file.
    On Client Server
    Reports 6.0.8.12.1
    Windows XP
    On 3 tier
    Reports 9.0.2.3.0
    Red Hat Linux
    Database 9.2.0.4.0
    Examples Here. This line generated in client server.
    Feb-06     ELDC     DATA TRANSFER     0     0     0     0     0     0     0     0     0
    Yet on 3 tier 9i. Also note the asterisk.
    Feb-06     ELDC     DATA TRANSFER     0     0     0     0     0     **     0     0     0
    Feb-06     ELDC     DATA TRANSFER     0     0     0     0     0     **     0     0     0
    Feb-06     ELDC     DATA TRANSFER     0     0     0     0     0     **     0     0     0
    Feb-06     ELDC     DATA TRANSFER     0     0     0     0     0     **     0     0     0
    Feb-06     ELDC     DATA TRANSFER     0     0     0     0     0     **     0     0     0
    Feb-06     ELDC     DATA TRANSFER     0     0     0     0     0     **     0     0     0
    Any ideas what is happening here.

    There are two ways you can work around this bug.
    1. Layout Model/Main Section\Property Palette --Set Report Height - 9999.
    Do this after you complete creating the layout. After completing the development of the report just change the report height to 9999
    2. Set page height to 0 in the report .prt file and use that file name in system paratmeters. ( desformat - *.prt file ) You have to copy this file to the server if you are running web reports. This will take care of all your delimited reports.
    To get rid of the asterisk try adding to_char for all the amount columns.
    Also, the font on Red Hat Linux may not be an exact match to the font in the report.

  • Hide duplicate rows in Cross Tab report

    where can i find the option to hide duplicate rows in cross tab report..?

    Is it a limitation with crosstab report..?
    Ok, here's the issue i have a crosstab report and its based on a VIEW.
    the data duplicates based on created_by and last_updated_by columns as I'm not using these columns in the report.
    any ideas or workarounds to avoid duplicates....?
    Thanks!

  • Identifying and reporting Duplicate rows from table

    I want to fetch all the duplicate row from the table and need to report all of it.
    I am trying to run the below query but and not getting the expected output. Please help me.
    Query
    SELECT * FROM ADDT_RPT_REQ A WHERE
    TRIM(A.EMAIL_ADDR) IN
    (SELECT TRIM(EMAIL_ADDR) FROM ADDT_RPT_REQ B
    WHERE TRIM(B.EMAIL_ADDR) = TRIM(A.EMAIL_ADDR)
    AND A.ph_num IN
    (SELECT PH_NUM FROM ADDT_RPT_REQ B
    WHERE TRIM(A.PH_NUM ) = TRIM(B.PH_NUM)
    There are in all 7 columns in the table where id is Unique Id.
    The expected output is something like.
    FST_NAME     LAST_NAME     EMAIL_ADDR     WORK_PH_NUM     ROW_ID     LAST_UPD     BU_ID
    VALERIE     HALL     [email protected]     7819370177     2-21N-4312     31-AUG-04     0-R9NH
    VALERIE     HALL     [email protected]     7819373737     2-21N-4327     29-JAN-04     0-R9NH
    VALERIE     HALL     [email protected]     6034272034     2-21N-4309     04-APR-03     0-R9NH
    VALERIE     HALL     [email protected]     7819373737     2-21N-4317     04-APR-03     0-R9NH
    VALERIE     HALL     [email protected]     8563748820     2-21N-4329     31-AUG-04     0-R9NH
    VALERIE     HALL     [email protected]     7819373737     2-21N-4319     04-APR-03     0-R9NH
    VALERIE     HALL     [email protected]     7819373737     2-21N-4326     04-APR-03     0-R9NH
    VALERIE     HALL     [email protected]     7819373737     2-21N-4324     04-APR-03     0-R9NH
    VALERIE     HALL     [email protected]     8604237395     2-21N-4330     31-AUG-04     0-R9NH
    VALERIE     HALL     [email protected]     7819373731     2-21N-4314     31-AUG-04     0-R9NH
    VALERIE     HALLORAN     [email protected]     6194771101     2-21N-4331     31-OCT-05     0-R9NH
    VALERIE     HALL     [email protected]     7819373737     2-21N-4316     04-APR-03     0-R9NH
    VALERIE     HALL     [email protected]     7819373737     2-21N-4321     04-APR-03     0-R9NH
    VALERIE     HALL     [email protected]     7819373737     7-1W4N-293     15-MAY-04     0-R9NH
    VALERIE     HALL     [email protected]     2032341604     2-21N-4307     31-AUG-04     0-R9NH
    VALERIE     HALL     [email protected]     7819373737     2-21N-4325     04-APR-03     0-R9NH
    VALERIE     HALL     [email protected]     7819373737     2-21N-4315     29-JAN-03     0-R9NH
    VALERIE     HALL     [email protected]     7819373737     7-1W4N-291     15-MAY-04     0-R9NH
    VALERIE     HALLORAN     [email protected]     6194771101     2-21N-4332     31-OCT-05     0-R9NH
    VALERIE     HALL     [email protected]     6038885349     2-21N-4310     31-AUG-04     0-R9NH
    VALERIE     HALL     [email protected]     7819373737324     2-21N-4328     31-AUG-04     0-R9NH
    VALERIE     HALL     [email protected]     7819370177324     2-21N-4313     31-AUG-04     0-R9NH

    Hi again!
    Try that:
    SELECT rowid, fst_name, last_name, email_addr, work_ph_num, row_id, last_upd, bu_id
    FROM ADDT_RPT_REQ A
    WHERE rowid > (SELECT MIN(rowid)
                   FROM ADDT_RPT_REQ B
                   WHERE B.fst_name = A.fst_name
                     AND B.last_name = A.last_name
                     AND B.email_addr = A.email_addr
                     AND B.work_ph_num = A.work_ph_num
                     AND B.row_id = A.row_id
                     AND B.last_upd = A.last_upd
                     AND B.bu_id = A.bu_id);This query should show you all duplicate rows. Use the rowid and DELETE to get rid of these rows.
    DELETE FROM addt_rpt_req A
    WHERE rowid IN (SELECT rowid
                    FROM   (SELECT rowid, row_number() OVER (PARTITION BY fst_name, last_name, email_addr, work_ph_num, row_id, last_upd, bu_id
                                                             ORDER BY row_id) dup
                            FROM addt_rpt_req)
                            WHERE dup > 1);Yours sincerely
    Florian W.
    Edited by: Florian W. on 17.06.2009 14:17

  • Eliminate duplicate rows from the report 6i output

    Hi All,
    I have generated a report output with the group by and summary options.
    For Ex: report has num and amount columns
    I had to sum the amount group by num
    NUM AMOUNT
    1 100
    1 50
    2 10
    2 100
    After group by and summary functions the report is generating the output as follows...
    NUM AMOUNT
    1 150
    1 150
    2 110
    2 110
    I want to eliminate the duplicate rows and want the output as follows...
    NUM AMOUNT
    1 150
    2 110
    I tried all the ways to implement distinct, but not able to.
    I donot want to implement distinct on the query but want to perform at the report level.
    Please help me in this ASAP.
    Thanks,
    Vijay

    It would be helpful if you post your query, should by something like
    SELECT NUM, SUM(AMOUNT)
      FROM TABLE
    GROUP BY NUM
    ORDER BY 1this would not create duplicates with your given example data.

  • Duplicate rows being eliminated from OBIEE reports...

    Hi,
    Duplicate rows are being eliminated from OBIEE reports even though I have not specified the 'DISTINCT' clause under the advanced tab of the answers request.
    I read somewhere that this is a bug and the only solution is to include the table key column.
    Please let me know if this is correct or if there is another solutiuon to prevent this issue.
    Thanks in advance.

    Hi user11935561,
    I've also noticed this too. And I did one of two things in the past:
    1) Yes, when applicable, I've added a unique identifier to the report so that duplicates were shown.
    2) Sometimes when I hit this I had a situation of a few dimensions in a report (lets say CUSTOMER and PRODUCT) and a measure (let's say sales $). If the customer 1 bought product A at $10, and he bought it on two different days, I was only seeing the DISTINCT record coming through, i.e. I was only seeing CUSTOMER 1 PROD A $10 instead of $20. Then I went into the RPD and changed the aggregation rule of Sales $ from None to SUM. The sum would force a group by get the correct information back from the RPD. So make sure you have your aggregate measures defined in the RPD and that should help you get around some of these issues.
    Hope this helps!
    Best regards,
    -Joe

  • Duplicate rows in Webi Report

    Anyone can pls tell me how to avoid duplicate rows in a webi report. I have tried checking the 'Avoid duplicate row agg.' option as well as 'Retrieve duplicate rows'.
    The query that is generated in the webi gives proper results wehn run at the database level but not in the report.
    What can be the problem?

    Hi VickyBobj,
    It's hard to know, but my guess is the way the objects are defined in the universe. Make sure your measures are defined correctly, as sum, count, etc. and also make sure you have placed dimensions and measures correctiy within the report format - meaning generally dimensions in the headers and measures in the body.
    Thanks

  • Crystal report returning duplicate rows - Linking issue?

    Hello,
    I know this is a commonly brought up issue - that duplicate rows are returned in Crystal reports for various reasons.  In a lot of instances, where it's only a single row of data per case that I'm looking for, I'll move them to their own group.  But that solution doesn't work here.
    The tables and links used in the simple report I have are illustrated in the attached "Report Database Expert Links.jpg" file, and the conditions and report fields required as as follows:
    Select Expert conditions:
    {CLAIM_PERIODS.CPE_START_DATE} < Today and
    {CLAIM_PERIODS.CPE_END_DATE} > Today and
    {CLAIM_ROLES.CRO_START_DATE} < Today and
    IsNull({CLAIM_ROLES.CRO_END_DATE})
    Report Design fields (in Details section):
    CLAIMS.CLA_REFNO, CLAIM_ROLES.CRT_CODE, PARTIES.PAR_PER_FORENAME, PARTIES.PAR_PER_SURNAME
    So what this report is to do:
    It looks for benefit claims which are live (have a CLAIM_PERIODS.CPE_START_DATE prior to today, and CLAIM_PERIODS.CPE_END_DATE after today), and for these claims gives a breakdown of all people in the household (everyone associated with that claim, where CLAIM_ROLES.START DATE is prior to today, and end date is null - to pick out those who are currently active in the household).
    This works fine otherwise, but the issue is that each live claim can have either one or two rows present in CLAIM_PARTS and CLAIM_PERIODS (so could satisfy my first two conditions twice).  For claims with only a single claim part active, I get each household member listed once.  But when they have two claim parts active, I get eveyone listed twice.
    Is there a way - either in how I'm linking the tables up, or how I'm arranging the report design, that I can have every household member only appear once no matter how many related rows there are in CLAIM_PARTS and CLAIM_PERIODS?
    Many thanks in advance,
    Sami
    P.S. I don't seem to be allowed to attache image files to my post, but have embedded the content instead:

    Thank you very much Don - this is a feature I wasn't aware of previously, and is a big step in the right direction for me.  Really useful.
    In the report mentioned, this sort of works.  It works very well on individual fields - so I could just "Suppress If Duplicated" on the forename and then remove duplicates on that column when exported to Excel (or simply bring in a unique field such as the party reference number and do likewise).
    However, is there a way to get Crystal to do this for me?  So to suppress the whole line based on whether or not I'm suppressing this one field?
    Just applying "Suppress If Duplicated" to all fields at once seems to have slightly unpredictable behaviour - not suppressing every field in the row.  So I experimented a bit with using the "Suppress" tick to do this, then applying a formula to it.  But the closest I can get for the formula is something like:
    -     {PARTIES.PAR_PER_FORENAME} = previous({PARTIES.PAR_PER_FORENAME}) and
    {PARTIES.PAR_PER_SURNAME} = previous({PARTIES.PAR_PER_SURNAME}) and
    Which will only compare the current row with previous.  Is there a way to do the same comparison but with all previous rows?

  • Report Builder 2.0 returning duplicate rows in query designer

    Hi,
    I have a query running off a model, when I explore the data in the model and in a standard sql table it returns one row for each record, which include a unique id for each which is correct.
    When I go into report builder query designer, it shows duplicate rows for each record. I have removed and added fields to try and pin point why and the only reason i can come up with is that it runs fine until I add in a field thats varchar(255) or
    varchar(max). This is when it starts to duplicate the records.
    Can anyone tell me why it does this or point me in the direction of how to stop this. I can't edit the query in text to add DISTINCT so thats not an option.
    Many thanks,
    JJSJ

    OK - I have found a partial answer.   By Googling Report Builder and VARCHAR, I found another post which reported problems with the semantic query builder when the underlying table/view was returning columns of type VARCHAR(MAX).   
    On looking at the length setting for the data column in the DSV,  this reported a length of 2,147,483,647 for this field.   This is very odd because on querying the underlying table the largest length that I can find for this column is 191,086
    (which is far larger than I would have expected - I am investigating this separately).
    However, why should the Report Model think that this field contains such a large value?
    Anyway,  the other post that I found reported that they had solved their problem by converting the field to a VARCHAR (255).    I tried this (by casting the column in my View to VARCHAR(255))  and this resolved the problem
    - no more duplicate rows when adding this field to the query!!!
    I also tried CASTING to TEXT and to VARCHAR(8000).  The former did not resolve the problem; the latter did.
    So I have a workaround but I don't understand why.  
    Can anybody explain why having a VARCHAR(max) column in my entity causes duplicate rows.    
    I suspect it is to do with the fact that for some reason the Report Model seems to think that there is an exceptionally long text string stored in this column in one of the rows but that again is a puzzle.
    Thanks
    Richard

  • Lookup transformation to avoid duplicate rows? - SSIS 2005

    Hi,
    I'm maintaning a SSIS 2005 pkg. I need to read a flat file to write on a SQL Server table, avoiding duplicates.
    I can have duplicates rows into the flat file to import and I need to prevent the insert of any rows already existing in the SQL Server table.
    So, I think to use a lookup transformation. I've created a flat file source, then I connect it to a lookup transformation and inside it I've specified as the reference table the SQL Server destination table. Then, I've checked the available lookup columns
    each adding as a new column: but the lookup task has arised an error and so I've specified as lookup operation the replacement. For each unmatching I need to write on the SQL Server table (the reference table in the lookup). For the lookup output error I've
    indicate to ignore failure. Other steps?
    However, when I run the pkg then inside the SQL Server destination table I can see only NULL values, but I want to see the rows don't already present in the table.
    Any suggests to me, please? Thanks

    Hi,
    I'm using SSIS 2005 as reported in the title of the post.
    I could have duplicates inside the source file and the existing table could haven't any rows.
    Thanks
    If you dont have any rows in existing table, then they will go through Error output in lookup task. For duplicates, lookup task will find matches and will go through lookup match output
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Duplicate rows in Oracle

    What would cause Oracle to insert duplicate rows into a table? Could a join of two tables in the initial query assigned to an application page cause ORacle to insert an extra row into a table when an update to data value occurs? I have no insert triggers and no foreign keys assigned to the table. I am not sure what would cause Oracle to assume that an insert of a row must occur. I want to prevent that insert.

    V Rickert wrote:
    What would cause Oracle to insert duplicate rows into a table? Could a join of two tables in the initial query assigned to an application page cause ORacle to insert an extra row into a table when an update to data value occurs? I have no insert triggers and no foreign keys assigned to the table. I am not sure what would cause Oracle to assume that an insert of a row must occur. I want to prevent that insert.Is there an APEX dimension to this? If so, tell us the full APEX and DB versions, and provide full details of what the APEX app is doing (a debug trace of page accept processing is the obvious place to start).
    The most likely explanations are:
    1. There is no duplicate in the table but there is a join problem in the query reporting on it, resulting in the appearance of a duplicate in the reults. Have you confirmed that the duplicate is really a physical row in the table?
    2. There is an APEX page/application process containing an insert on the table that is unexpectedly running on page accept due to it having no condition or an incorrect condition. This will be visible in the Debug trace.

  • Duplicate rows in Crystal XI

    Post Author: lfarrington
    CA Forum: General
    I have a report that was written in the version of Crystal that is part of Visual Studio 2005.  This report worked fine until we upgraded our server to run Crystal XI.  Now I have duplicated rows on the report.  I am not sure what to look for to find the problem. The report is running against a dataset and I have confirmed that the dataset does not have duplicate rows.  I'm assuming the joins are ok because the report works in the older version of Crystal.  Can anyone give me some ideas on where to look for this?
    thanks in advance,
    Linda

    Post Author: lfarrington
    CA Forum: General
    Thanks for your response.  All the fields in the row are duplicated.  They appear x number of times - one for each row in one of the other tables in my dataset. (This is why I was originally thinking that it might be a join problem.)   I cannot check the SQL statement because it is disabled.  I think that is because we're using an ado.net dataset.

  • How to force duplicate row display automatically

    In answers, we have one table that has duplicate data. The only thing different between some rows is the ROWID. When use user requests data, Answers automatically suppresses the duplicate rows. How can I force answers to display all rows and not suppress duplicate values?
    For example - db table contains
    COL-A COL-B COL-C
    ABC 3 5
    DEF 2 1
    DEF 2 1
    When adding COL A, B, and C to a report - Answers will display:
    ABC 3 5
    DEF 2 1
    How do I get answers to display
    ABC 3 5
    DEF 2 1
    DEF 2 1
    automatically?
    Thanks!

    I did as instructed - remove the check for DISTINCT_SUPPORTED from all DATABASE connections, saved the repository and recycled BI server and Presentation services. Unfortunately, there was no impact to suppression.
    My DB is Oracle 10.2.0.4 on Windows 2003.
    In addition, we have the following connection strings in place to allow for case-insensitive searches:
    alter session set NLS_SORT=BINARY_CI
    alter session set NLS_COMP=LINGUISTIC

Maybe you are looking for

  • Thunar, Tumbler and (un)mounting

    Hello everyone, I have the following problem, and I suspect it's a bug of some sort. If I insert a USB stick, memory card or any other sort of removable media, and I access a folder which contains images that can be thumbnailed by Tumbler, it will ru

  • How to display html:select in Edit page using same options as in Add page

    Hi, <html:select property="tblAssociateDetailsVisaType">             <html:option value="H1">H1</html:option> </html:select>I want small help - I have two functionalities 1.add 2.Update In Add i have nearly 10 dropdown lists with average 20 options,

  • Can automator use the content of a cell ( in excel) to save a file ?

    Join Date: Mar 2009 Automator & excel Hello there, I'm not so good at automator and I need some help. I have a lot of excelsheet to make. Each sheet is about a customer ans should go to a specific folder. As i am naming the folders by date followed b

  • New HP Envy15 release date in France (and Taiwan?)

    Hello there! I'm very interested in getting the latest HP Envy15, but so far it seems it's only available in the US... When will it be released in France and/or Taiwan? Also, if it is released in those countries, will it be as customizable as it is i

  • Rendering issue in FCE

    Hi-i have created a project in imovie, opened it up in fce for editing, some of the sequences render and some don't. i keep getting "general error" when the files don't render. i am using an external hard drive to store files. when i removed the audi