Discoverer Analytic Function windowing - errors and bad aggregation

I posted this first on Database General forum, but then I found this was the place to put it:
Hi, I'm using this kind of windowing function:
SUM(Receitas Especificas) OVER(PARTITION BY Tipo Periodo,Calculado,"Empresa Descrição (Operador)","Empresa Descrição" ORDER BY Ini Periodo RANGE BETWEEN INTERVAL '12' MONTH PRECEDING AND INTERVAL '12' MONTH PRECEDING )
If I use the "Receitas Especificas SUM" instead of
"Receitas Especificas" I get the following error running the report:
"an error occurred while attempting to run..."
This is not in accordance to:
http://www.boku.ac.at/oradoc/ias/10g(9.0.4)/bi.904/b10268.pdf
but ok, the version without SUM inside works.
Another problem is the fact that for analytic function with PARTITION BY,
this does not work (shows the cannot aggregate symbol) if we collapse or use "<All>" in page items.
But it works if we remove the item from the PARTITION BY and also remove from workbook.
It's even worse for windowing functions(query above), because the query
only works if we remove the item from the PARTITION BY but we have to show it on the workbook - and this MAKES NO SENSE... :(
Please help.

Unfortunately Discoverer doesn't show (correct) values for analytical functions when selecting "<All>" in a page item. I found out that it does work when you add the analytical function to the db-view instead of to the report as a calculation or as a calculated item on the folder.
The only problem is you've to name all page-items in the PARTITION window, so, when adding a page-item to the report, you,ve to change the db-view and alter the PARTITION window.
Michael

Similar Messages

  • Window Errors and Warning in this Transaction not shown

    We're using Designer 6.5.82.3.0.
    Business rules aren't generated according to CDM Ruleframe, no CAPI. But Table API/trigger logic.
    => Pre-Before-Insert-Row
    BEGIN
    if CDR_CPN.F_CPN_UNIQUE(:new.CODE)
    then
    -- a new code
    null;
    else
    -- code already exists
    QMS$ERRORS.SHOW_MESSAGE
    ('CDR-05000'
    ,:new.CODE);
    end if;
    END;
    When an business rule fails the window Errors and Warning in this Transaction with the error-message is not shown. Instead we get the message Transaction failed
    (when using sqlplus the same message appears, then running @messages.sql =>correct message)
    According to a previous discussion the ON-ERROR of the module component should be modified (author Bart van Ges 22 May 2002). And this works, the window Errors and Warning in this Transaction is shown with the correct message.
    Has anyone another solution, patch or any idea why the window doesn't appear without the modification?
    Cheers,
    Bob

    All,
    Since Headstart for 6.0 (patch 12) and Headstart for 6i, Headstart default only functions well in combination with CDM RuleFrame. If you want to deviate from this standard, the functionality in the libraries should be adapted for this purpose. There are several ways to do this:
    - show serverside errors in an error Alert window
    - show serverside errors in the RuleFrame transaction and errors window.
    Whatever approach you choose - in this thread several suggestions are being made - it is not documented in headstart how to do this. The Oracle Headstart group is not able at this moment to investigate time to workout the alternatives, though I will add an enhancement request to headstart to document these options in the headstart user guide.
    Two extra suggestions:
    - try to test your workaround as well as possible (try to raise errors from server, client, try to violate server constraints (pk, uk, fk, ck) and try to let serverside pl/sql fail.
    - if you do not make use of ruleframe, you might run into a problem if you try to commit in the serverside logic, in this case remove the calls in the template package (qms$even_form) to open and close the transaction (pre-commit and post-forms-commit trigger events).
    Regards,
    Marc Vah[i]Long postings are being truncated to ~1 kB at this time.

  • BSOD with both Kernal Security Check Error and Bad Pool Header.

    All -
    I have a HP DV7 laptop with Windows 8.1. It has BSOD with both Kernal Security Check Error and Bad Pool Header.
    Despite doing all the built in HP tests, there is nothing. Using an Anker HardDrive Dock results in the identical errors on another machine.
    Bottom line, even if I could see the DMP files (which I cannot); because the machine fails to boot, there are no files to be copied.
    I have tried various AIO and UEFI disks and USB, and the laptop NEVER accepts the PREINSTALL environment. Being unable to use the Anker has never happened. I seem completely locked out of the drive. Any suggestions? Thx.
    Bruce A Ades

    Hi Texas_Bruiser
    Some required details are needed for us to help you.
    Ensure that the BIOS/UEFI has been configured to allow boot from DVD/CD or USB.
    When you attempted to boot into PREINSTALL environment (PE) by using disks or USB, we need more details about error message or what happened?
    If your computer cannot even boot into Windows PE by using installation media, we suggest you check if memory and other hardware are works properly on this computer. Also try to plug this hard disk on other computer as data volume, see if the hard disk works.
    Regards
    D. Wu

  • Henever I am in Mozilla I get a pop up saying my PC has 7 window errors and can run faster. I cannot see how to get rid of this.

    I tried to download Tetris yesterday onto my laptop - not quite what you would call an ambitious gamer!
    As it was doing so I noticed that the software was trying to alter some settings in the registry.
    Now whenever I am in Mozilla I get a pop up saying my PC has 7 window errors and can run faster. I cannot see how to get rid of this.
    When I copy the link location it says:
    https://secure-ams.adnxs.com/click?KGIRww5jtj8oYhHDDmO2PwAAAICXbtI_KGIRww5jtj8oYhHDDmO2Py8cBrFeTaRkUe4MK_5ewBbHVyJRAAAAAMypEAA_AQAAPwEAAAIAAAAwB0YA6-ECAAAAAQBVU0QAVVNEACwB-gDulQAA42kAAQMCAQUAAIQARiCzrAAAAAA./cnd=%21ngVsMQjTqzoQsI6YAhjrwwsgBA../referrer=https%3A%2F%2Fwww.google.co.uk%2F/clickenc=http%3A%2F%2Fappround.net%2Fpcperformer%2Fst6%2Fpcperformer-st6.php%3Fcid%3D3902%26tid%3Dams1CNHcs9ji35fgFhACGK-4mIjrq5PSZCIOMjEzLjc4LjE0NC4yMTQoAQ..
    and here is the image
    Any ideas?

    Such a pop-up is likely caused by malware installed on your computer.
    Do a malware check with some malware scanning programs on the Windows computer.<br />
    You need to scan with all programs because each program detects different malware.
    Make sure that you update each program to get the latest version of their databases before doing a scan.
    *Malwarebytes' Anti-Malware:<br>http://www.malwarebytes.org/mbam.php
    *SuperAntispyware:<br>http://www.superantispyware.com/
    *Microsoft Safety Scanner:<br>http://www.microsoft.com/security/scanner/en-us/default.aspx
    *Windows Defender: Home Page:<br>http://www.microsoft.com/windows/products/winfamily/defender/default.mspx
    *Spybot Search & Destroy:<br>http://www.safer-networking.org/en/index.html
    *Kasperky Free Security Scan:<br>http://www.kaspersky.com/security-scan
    You can also do a check for a rootkit infection with TDSSKiller.
    *http://support.kaspersky.com/viruses/solutions?qid=208280684
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • AVG as an analytic function - gives error ORA-0439

    I'm trying my first implementation of AVG as an analytic function. I took the following query which gave a simple average:
    SELECT
    PERSON.LASTNAME,
    COUNT(TO_NUMBER(RPTOBS.OBSVALUE)) CNT,
    AVG(TO_NUMBER(RPTOBS.OBSVALUE)) AVRG
    FROM
    TUT.PERSON PERSON,
    TUT.RPTOBS RPTOBS
    WHERE
    PERSON.PID = RPTOBS.PID AND
    RPTOBS.HDID = 54
    GROUP BY
    PERSON.LASTNAME;
    and was rewrote this to give an average of the values of the last 3 dates (I think..)
    SELECT
    PERSON.LASTNAME,
    RPTOBS.OBSDATE,
    AVG(TO_NUMBER(RPTOBS.OBSVALUE))
    OVER
    (PARTITION BY PERSON.LASTNAME
    ORDER BY RPTOBS.OBSDATE
    ROWS BETWEEN UNBOUNDED PRECEDING AND 2 FOLLOWING)
    AS AVRG3
    FROM
    TUT.PERSON PERSON,
    TUT.RPTOBS RPTOBS
    WHERE
    PERSON.PID = RPTOBS.PID AND
    RPTOBS.HDID = 54;
    (this seemed to be a direct translation of a similar query in the SQL Reference.
    I am getting an error message of:
    ORA-0439 - feature not enabled - OLAP Window Functions
    Can some one tell me why?
    Thanks,
    Will Salomon
    [email protected]

    I haven'y done it personally, but I am told that it's really as simple as de-insatlling the Standard Edition software and then installing the Enterprise Edition. Th einstaller will prompt you for an Oracle SID and you just have to point it to your existing database.
    You may wish to test this proposition before risking your actual system. But, in any case, take a back up.
    With 9i things are simpler: everyting gets installed, you're just not allowed to use the EE features if you haven't paid for them.
    Cheers, APC

  • Consistent windows errors and installation issues with win 7

    I am experiencing repeated blue screen errors (bad pool error and failed to clock interrupt among others) and now have issues with enabling windows firewall (error 8007042c) among various other windows errors also windows restore is not working would appreciate
    any advice thank you.

    Hi,
    Please refer to this KB to troubleshoot the windows firewall (error 8007042c), begin with scanning for malware.
    http://support.microsoft.com/kb/2530126
    Regarding to the blue screen, I sugegst you keep Windows up-to-date, install latest drivers, if this doesn't help, please upload the latest dump files to a public location like OneDrive, then paste the downlaod link here for further analysis. (default location:
    %SystemRoot%\MEMORY.DMP or minidump)
    http://windows.microsoft.com/en-in/onedrive/share-file-folder
    Yolanda Zhu
    TechNet Community Support

  • Cant find print function windows 8 and adobe reader

    I have windows 8 and adobe reader 9.5. how do i print?

    I resolved my issue! The new app format with windows 8 takes time to master. The adobe reader does not have a friendly toolbar. No print function on the bottom tool bar when all other actions except printing are noted. I finally decided to check my main side tool bar and there was my printer seeing the adobe file and ready to print. So I resolved my issue but very much appreciate your reaching out to help me. Thank you!

  • HP Deskjet 3050A J611 series - error message -Bad image windows\system 32\d3d 10 warp.dll

    I use the HP Deskjet 3050A J611 series printer with my laptop and a desktop PC.  It works fine with the laptop but when I installed the software onto the desktop the window error message Bad Image Windows\ System 32\d3d 10 warp.dll kept popping up every few minutesd.  By a process of ilimination I discovered that it was the Photo Creations that was causing the problems, when I removed it all was good and I was able to use the printer.  The only problems is that I now cannot print photos from my pc.  I have windows 7.
    Can anyone help please?

    Hi Chris.
    That error message comes from Direct3D, which is part of the DirectX software in Windows. It appears that part of the DirectX environment on your computer is corrupt. Microsoft provides a diagnostic tool that should help you sort this out. Please see http://windows.microsoft.com/en-us/windows-vista/run-directx-diagnostic-tool
    If that does not solve the issue, you may want to reinstall the device driver for your graphics adapter.
    When all's running smoothly, you can reinstall HP Photo Creations to print again. Our customer support team would be happy to help with the reinstallation. You can reach them at www.hp.com/global/us/en/consumer/digital_photography/free/software/support-form.html
    Hope this helps,
    RocketLife
    RocketLife, developer of HP Photo Creations
    » Visit the HP Photo Creations Facebook page — news, tips, and inspiration
    » See the HP Photo Creations video tours — cool tips in under 2 minutes
    » Contact Customer Support — get answers from the experts

  • SmartHeap error MEM-BAD-POINTER

    Hi all,
    i have installed discoverer 10g tool (admin and desktop) on my machine having Window Vista. whenever i try to run the desktop or the admin i get a pop up window error
    MEM-BAD-POINTER
    whenever i click on ok i get the detailed error: "Smarheap Error handler recursively re-entered"
    can anyone help me on this.
    thx
    Patrick

    I raised SR today about this topic and received info that actually Oracle does not certify any software for Vista.
    The first one will be Oracle Server, ale the rest will follow.
    The solution for this problem was ( from BUG: 5945722 on metalink ):
    "The reported errors are coming because smartheap library SH31W32.DLL is of
    3.1.0.0 version which is quite old. This version of SH31W32.DLL is not Vista
    compliant and because of this we are getting the MEM_BAD_POINTER error.
    The reported issue goes away if we use the 4.1.1.0 version of smart heap. I
    have uploaded the new version of SH31W32.DLL to
    @ ftp://bugftp.us.oracle.com/upload/bug5945722. Please copy this dll to
    %ORACLE_HOME%/bin and verify that the issue gets resolved. "
    ... but this link does not exist so i decided to raise an SR with request to restore file located on the ftp. I will keep You informed if there will be any importaint action about solving this issue.
    RGDS
    Marcin M.

  • Speed up query with analytic function

    Hi
    how can I speed up the query below ?
    All time is in analytic function (WINDOW SORT)
    Thanks for your help
    11.2.0.1
    Rows     Row Source Operation
      28987  HASH UNIQUE (cr=12677 pr=155778 pw=109730 time=25010 us cost=5502 size=3972960 card=14880)
    1668196   WINDOW SORT (cr=12677 pr=155778 pw=109730 time=890411840 us cost=5502 size=3972960 card=14880)
    1668196    HASH JOIN RIGHT OUTER (cr=12677 pr=0 pw=0 time=1069165 us cost=3787 size=3972960 card=14880)
      30706     TABLE ACCESS FULL FLO_FML_EVENT (cr=270 pr=0 pw=0 time=7420 us cost=56 size=814158 card=30154)
    194733     HASH JOIN RIGHT OUTER (cr=12407 pr=0 pw=0 time=571145 us cost=3730 size=3571200 card=14880)
        613      VIEW  (cr=342 pr=0 pw=0 time=489 us cost=71 size=23840 card=745)
        613       HASH UNIQUE (cr=342 pr=0 pw=0 time=244 us cost=71 size=20115 card=745)
        745        WINDOW SORT (cr=342 pr=0 pw=0 time=1736 us cost=71 size=20115 card=745)
        745         MAT_VIEW ACCESS FULL MVECRF_CUR_QUERY (cr=342 pr=0 pw=0 time=1736 us cost=69 size=20115 card=745)
    194733      HASH JOIN  (cr=12065 pr=0 pw=0 time=431813 us cost=3658 size=3095040 card=14880)
         43       MAT_VIEW ACCESS FULL MVECRF_VISIT_REVS (cr=3 pr=0 pw=0 time=0 us cost=2 size=946 card=43)
    194733       HASH JOIN OUTER (cr=12062 pr=0 pw=0 time=292098 us cost=3656 size=2767680 card=14880)
    194733        HASH JOIN OUTER (cr=10553 pr=0 pw=0 time=234394 us cost=2962 size=2574240 card=14880)
    194733         HASH JOIN  (cr=9999 pr=0 pw=0 time=379996 us cost=2570 size=2380800 card=14880)
      30076          MAT_VIEW ACCESS FULL MVECRF_ACTIVATED_FORMS (cr=1817 pr=0 pw=0 time=28411 us cost=361 size=2000285 card=29855)
    194733          HASH JOIN  (cr=8182 pr=0 pw=0 time=209061 us cost=1613 size=9026301 card=97057)
        628           MAT_VIEW ACCESS FULL MVECRF_STUDYVERSION_FORMS (cr=19 pr=0 pw=0 time=250 us cost=6 size=18212 card=628)
    194733           MAT_VIEW ACCESS FULL MVECRF_FORMITEMS (cr=8163 pr=0 pw=0 time=80733 us cost=1606 size=12462912 card=194733)
    132342         MAT_VIEW ACCESS FULL MVECRF_ITEM_SDV (cr=554 pr=0 pw=0 time=23678 us cost=112 size=1720446 card=132342)
    221034        MAT_VIEW ACCESS FULL MVECRF_ITEMDATA (cr=1509 pr=0 pw=0 time=46459 us cost=299 size=2873442 card=221034)
    SELECT              
          DISTINCT
             'CL238093011' AS ETUDE,
             FI.STUDYID,
             FI.STUDYVERSIONID,
             FI.SITEID,
             FI.SUBJECTID,
             FI.VISITID,
             VR.VISITREFNAME,
             FI.SUBJECTVISITID,
             FI.FORMID,
             FI.FORMINDEX,
             SVF.FORMREFNAME,
             SVF.FORMMNEMONIC AS FMLNOM,
             EVENT_ITEM.EVENT AS EVENUM,
             EVENT_ITEM.EVENT_ROW AS LIGNUM,
             NULL AS CODVISEVE,
             MIN(DID.MINENTEREDDATE)
                OVER (
                   PARTITION BY FI.SUBJECTID, FI.VISITID, FI.FORMID, FI.FORMINDEX
                AS ATTDAT1ERSAI,
             MIN(IFSDV.ITEMFIRSTSDV)
                OVER (
                   PARTITION BY FI.SUBJECTID, FI.VISITID, FI.FORMID, FI.FORMINDEX
                AS ATTDAT1ERSDV,
             MAX(IFSDV.ITEMFIRSTSDV)
                OVER (
                   PARTITION BY FI.SUBJECTID, FI.VISITID, FI.FORMID, FI.FORMINDEX
                AS ATTDATDERSDV,
             DECODE (AF.SDVCOMPLETESTATE,
                     0,
                     'N',
                     1,
                     'Y')
                AS ATTINDSDVCOP,
             AF.FMINSDVCOMPLETESTATE AS ATTDAT1ERSDVCOP,
             DECODE (AF.SDVPARTIALSTATE,
                     0,
                     'N',
                     1,
                     'Y')
                AS ATTINDSDVPTL,
             EVENT_ITEM.EVENT_RELECT AS ATTINDRVUMEDCOP,
             DECODE (QUERY.NBQSTFML, NULL, 'N', 'Y') AS ATTINDQST,
             DECODE (AF.MISSINGITEMSSTATE,
                     0,
                     'N',
                     1,
                     'Y')
                AS ATTINDITMABS,
             DECODE (AF.FROZENSTATE,
                     0,
                     'N',
                     1,
                     'Y')
                AS ATTINDETACON,
             AF.FMINFROZENSTATE AS ATTDAT1ERCON,
             AF.FMAXFROZENSTATE AS ATTDATDERCON,
             DECODE (AF.DELETEDSTATE,
                     0,
                     'N',
                     1,
                     'Y')
                AS ATTINDETASPR,
             EVENT_ITEM.ROW_DELETED AS ATTINDLIGSPR
      FROM   CL238093011.MVECRF_FORMITEMS FI,
             CL238093011.MVECRF_STUDYVERSION_FORMS SVF,
             CL238093011.MVECRF_ACTIVATED_FORMS AF,
             CL238093011.MVECRF_ITEM_SDV IFSDV,
             CL238093011.MVECRF_VISIT_REVS VR,
             CL238093011.MVECRF_ITEMDATA DID,
             (SELECT   DISTINCT
                       SUBJECTID,
                       VISITID,
                       FORMID,
                       FORMINDEX,
                       COUNT (
                          DISTINCT QUERYID
                          OVER (
                             PARTITION BY SUBJECTID, VISITID, FORMID, FORMINDEX
                          NBQSTFML
                FROM   CL238093011.MVECRF_CUR_QUERY
               WHERE   QUERYSTATE IN (0, 1, 2)) QUERY,
             CL238093011.FLO_FML_EVENT EVENT_ITEM
    WHERE   (AF.VISITDELETED IS NULL OR AF.VISITDELETED = 0)
             AND AF.FORMTYPE NOT IN (4, 5, 6, 7, 8, 103)
             AND (AF.DELETEDDYNAMICFORMSTATE IS NULL
                  OR AF.DELETEDDYNAMICFORMSTATE = 0)
             AND FI.SUBJECTVISITID = AF.SUBJECTVISITID
             AND FI.FORMID = AF.FORMID
             AND FI.FORMREV = AF.FORMREV
             AND FI.FORMINDEX = AF.FORMINDEX
             AND FI.VISITID = VR.VISITID
             AND FI.VISITREV = VR.VISITREV
             AND FI.CONTEXTID = IFSDV.CONTEXTID(+)
             AND FI.CONTEXTID = DID.CONTEXTID(+)
             AND FI.SUBJECTID = QUERY.SUBJECTID(+)
             AND FI.VISITID = QUERY.VISITID(+)
             AND FI.FORMID = QUERY.FORMID(+)
             AND FI.FORMINDEX = QUERY.FORMINDEX(+)
             AND FI.STUDYVERSIONID = SVF.STUDYVERSIONID
             AND FI.FORMID = SVF.FORMID
             AND FI.VISITID = SVF.VISITID
             AND FI.SUBJECTID = EVENT_ITEM.SUBJECTID(+)
             AND FI.VISITID = EVENT_ITEM.VISITID(+)
             AND FI.FORMID = EVENT_ITEM.FORMID(+)
             AND FI.FORMINDEX = EVENT_ITEM.FORMINDEX(+)

    user12045475 wrote:
    Hi
    how can I speed up the query below ?
    All time is in analytic function (WINDOW SORT)
    Thanks for your help
    11.2.0.1
    Rows     Row Source Operation
    28987  HASH UNIQUE (cr=12677 pr=155778 pw=109730 time=25010 us cost=5502 size=3972960 card=14880)
    1668196   WINDOW SORT (cr=12677 pr=155778 pw=109730 time=890411840 us cost=5502 size=3972960 card=14880)
    1668196    HASH JOIN RIGHT OUTER (cr=12677 pr=0 pw=0 time=1069165 us cost=3787 size=3972960 card=14880)
    30706     TABLE ACCESS FULL FLO_FML_EVENT (cr=270 pr=0 pw=0 time=7420 us cost=56 size=814158 card=30154)
    194733     HASH JOIN RIGHT OUTER (cr=12407 pr=0 pw=0 time=571145 us cost=3730 size=3571200 card=14880)
    613      VIEW  (cr=342 pr=0 pw=0 time=489 us cost=71 size=23840 card=745)
    613       HASH UNIQUE (cr=342 pr=0 pw=0 time=244 us cost=71 size=20115 card=745)
    745        WINDOW SORT (cr=342 pr=0 pw=0 time=1736 us cost=71 size=20115 card=745)
    745         MAT_VIEW ACCESS FULL MVECRF_CUR_QUERY (cr=342 pr=0 pw=0 time=1736 us cost=69 size=20115 card=745)
    194733      HASH JOIN  (cr=12065 pr=0 pw=0 time=431813 us cost=3658 size=3095040 card=14880)
    43       MAT_VIEW ACCESS FULL MVECRF_VISIT_REVS (cr=3 pr=0 pw=0 time=0 us cost=2 size=946 card=43)
    194733       HASH JOIN OUTER (cr=12062 pr=0 pw=0 time=292098 us cost=3656 size=2767680 card=14880)
    194733        HASH JOIN OUTER (cr=10553 pr=0 pw=0 time=234394 us cost=2962 size=2574240 card=14880)
    194733         HASH JOIN  (cr=9999 pr=0 pw=0 time=379996 us cost=2570 size=2380800 card=14880)
    30076          MAT_VIEW ACCESS FULL MVECRF_ACTIVATED_FORMS (cr=1817 pr=0 pw=0 time=28411 us cost=361 size=2000285 card=29855)
    194733          HASH JOIN  (cr=8182 pr=0 pw=0 time=209061 us cost=1613 size=9026301 card=97057)
    628           MAT_VIEW ACCESS FULL MVECRF_STUDYVERSION_FORMS (cr=19 pr=0 pw=0 time=250 us cost=6 size=18212 card=628)
    194733           MAT_VIEW ACCESS FULL MVECRF_FORMITEMS (cr=8163 pr=0 pw=0 time=80733 us cost=1606 size=12462912 card=194733)
    132342         MAT_VIEW ACCESS FULL MVECRF_ITEM_SDV (cr=554 pr=0 pw=0 time=23678 us cost=112 size=1720446 card=132342)
    221034        MAT_VIEW ACCESS FULL MVECRF_ITEMDATA (cr=1509 pr=0 pw=0 time=46459 us cost=299 size=2873442 card=221034)
    SELECT              
    DISTINCT
    'CL238093011' AS ETUDE,
    FI.STUDYID,
    FI.STUDYVERSIONID,
    FI.SITEID,
    FI.SUBJECTID,
    FI.VISITID,
    VR.VISITREFNAME,
    FI.SUBJECTVISITID,
    FI.FORMID,
    FI.FORMINDEX,
    SVF.FORMREFNAME,
    SVF.FORMMNEMONIC AS FMLNOM,
    EVENT_ITEM.EVENT AS EVENUM,
    EVENT_ITEM.EVENT_ROW AS LIGNUM,
    NULL AS CODVISEVE,
    MIN(DID.MINENTEREDDATE)
    OVER (
    PARTITION BY FI.SUBJECTID, FI.VISITID, FI.FORMID, FI.FORMINDEX
    AS ATTDAT1ERSAI,
    MIN(IFSDV.ITEMFIRSTSDV)
    OVER (
    PARTITION BY FI.SUBJECTID, FI.VISITID, FI.FORMID, FI.FORMINDEX
    AS ATTDAT1ERSDV,
    MAX(IFSDV.ITEMFIRSTSDV)
    OVER (
    PARTITION BY FI.SUBJECTID, FI.VISITID, FI.FORMID, FI.FORMINDEX
    AS ATTDATDERSDV,
    DECODE (AF.SDVCOMPLETESTATE,
    0,
    'N',
    1,
    'Y')
    AS ATTINDSDVCOP,
    AF.FMINSDVCOMPLETESTATE AS ATTDAT1ERSDVCOP,
    DECODE (AF.SDVPARTIALSTATE,
    0,
    'N',
    1,
    'Y')
    AS ATTINDSDVPTL,
    EVENT_ITEM.EVENT_RELECT AS ATTINDRVUMEDCOP,
    DECODE (QUERY.NBQSTFML, NULL, 'N', 'Y') AS ATTINDQST,
    DECODE (AF.MISSINGITEMSSTATE,
    0,
    'N',
    1,
    'Y')
    AS ATTINDITMABS,
    DECODE (AF.FROZENSTATE,
    0,
    'N',
    1,
    'Y')
    AS ATTINDETACON,
    AF.FMINFROZENSTATE AS ATTDAT1ERCON,
    AF.FMAXFROZENSTATE AS ATTDATDERCON,
    DECODE (AF.DELETEDSTATE,
    0,
    'N',
    1,
    'Y')
    AS ATTINDETASPR,
    EVENT_ITEM.ROW_DELETED AS ATTINDLIGSPR
    FROM   CL238093011.MVECRF_FORMITEMS FI,
    CL238093011.MVECRF_STUDYVERSION_FORMS SVF,
    CL238093011.MVECRF_ACTIVATED_FORMS AF,
    CL238093011.MVECRF_ITEM_SDV IFSDV,
    CL238093011.MVECRF_VISIT_REVS VR,
    CL238093011.MVECRF_ITEMDATA DID,
    (SELECT   DISTINCT
    SUBJECTID,
    VISITID,
    FORMID,
    FORMINDEX,
    COUNT (
    DISTINCT QUERYID
    OVER (
    PARTITION BY SUBJECTID, VISITID, FORMID, FORMINDEX
    NBQSTFML
    FROM   CL238093011.MVECRF_CUR_QUERY
    WHERE   QUERYSTATE IN (0, 1, 2)) QUERY,
    CL238093011.FLO_FML_EVENT EVENT_ITEM
    WHERE   (AF.VISITDELETED IS NULL OR AF.VISITDELETED = 0)
    AND AF.FORMTYPE NOT IN (4, 5, 6, 7, 8, 103)
    AND (AF.DELETEDDYNAMICFORMSTATE IS NULL
    OR AF.DELETEDDYNAMICFORMSTATE = 0)
    AND FI.SUBJECTVISITID = AF.SUBJECTVISITID
    AND FI.FORMID = AF.FORMID
    AND FI.FORMREV = AF.FORMREV
    AND FI.FORMINDEX = AF.FORMINDEX
    AND FI.VISITID = VR.VISITID
    AND FI.VISITREV = VR.VISITREV
    AND FI.CONTEXTID = IFSDV.CONTEXTID(+)
    AND FI.CONTEXTID = DID.CONTEXTID(+)
    AND FI.SUBJECTID = QUERY.SUBJECTID(+)
    AND FI.VISITID = QUERY.VISITID(+)
    AND FI.FORMID = QUERY.FORMID(+)
    AND FI.FORMINDEX = QUERY.FORMINDEX(+)
    AND FI.STUDYVERSIONID = SVF.STUDYVERSIONID
    AND FI.FORMID = SVF.FORMID
    AND FI.VISITID = SVF.VISITID
    AND FI.SUBJECTID = EVENT_ITEM.SUBJECTID(+)
    AND FI.VISITID = EVENT_ITEM.VISITID(+)
    AND FI.FORMID = EVENT_ITEM.FORMID(+)
    AND FI.FORMINDEX = EVENT_ITEM.FORMINDEX(+)
    Do you have the license for parallel query (may/may not help)? PQO can help with sorts ...

  • How to use sum analytic function in adf

    Hi
    jdev 11.1.1.5
    oracle 11g r2
    I want to use analytic function (sum,count,avg and ...) .
    I see [url http://andrejusb.blogspot.co.uk/2013/02/oracle-analytic-functions-for-total-and.html]Oracle Analytic Functions for Total and Average Calculation in ADF BC
    and use it in my vo and jsf page,my vo have too much record and I want to have sum in table footer on demand (because of performance) and if user do not want to see the sum in footer of table it do not calculate sum,
    what is your idea?

    Before I read that blog I use another vo for sum but after that blog decide to use analytic fuction becuase we have some page that have to many dvt graph and table and know we use seperate vo for them and it has not good performance and too many query must run in database ,I want to have 1 vo with some analytic function for graph and tables

  • What (the hell) is SQL Exception called Function sequence error?

    ...doing in a code like this:
    ResultSet friends=...executeQuery...
    while (friends.next())
    log.append(friends.getString("sendergsm"));
    somewhere in between that loop, or sometimes the loop runs out fine, and sometimes it throws SQLException called General Error. Not guite normal...

    Thank you for replying... that must be agains some of the policies of the sun, to make methods that may be called normally, but may cause an error.
    Anyway, this is my first database application. The number of problems I've had in few days is unbelivable. I wonder does it load the drivers from disk or something everytime it reads one record from database. I mean when I did the above query, the table had about 10 entries (the program showed 5 to 10 before function sequense error) and displaying each record to TextArea took over second. (In paradox (The dosversion) this would have taken less than a second).
    And paradox tables doesn't work at all because it raises exception: Table isn't expected format. If I set paradox 4.0 drivers and put paradox 4.0 tables, you would guess that the format would be expected. And you cannot create paradox tables with SQL. Now I need to use access databases. How can database containing 60 records be 500kb:s? When it will contain 50000 new records every day, i guess I'll be in problem. Each tranaction (say 5 simple queries) taking minutes... heelp meee!!

  • Using analytic function in a view

    Hello to all
    Sorry If I use this thread
    sql not merge using analytic functions
    for my question,
    From example you write and from Tom explain is not possible create a view on analytic function?
    Thanks and sorry again

    I think what you'll discover is that if you apply the function over the result set, the initial SQL might be quicker,
    for example, this is a test I did with a large dictionary view:
    select tp.Table_Name
          ,tp.Partition_Name
    from
          select tbl.Table_Name         as Table_Name
                ,tbl.Partition_Date     as dt
                ,row_number() over (partition by dtp.table_Name order by dtp.Partition_Name desc) rn
          from (
                select  /*+ all_rows */
                        dtp.Table_Name
                       ,dtp.Partition_name
                from    dba_tab_partitions  dtp
                where   dtp.Partition_Name  like 'Y____\_Q_\_M__\_D__' escape '\'
                and     dtp.Table_Owner     =  'APPS'
                and     dtp.Table_name      not like '%$%'
                and     dtp.Table_Name      like '%'
               ) tbl
        ) tp
    where tp.rn = 1
    select Table_Name
          ,Partition_Name
    from (
          select  /*+ all_rows */
                  dtp.Table_Name
                 ,row_number() over (partition by tbl.table_Name order by tbl.Partition_Name desc) rn
          from    dba_tab_partitions  dtp
          where   dtp.Partition_Name  like 'Y____\_Q_\_M__\_D__' escape '\'
          and     dtp.Table_Owner     =  'APPS'
          and     dtp.Table_name      not like '%$%'
          and     dtp.Table_Name      '%'
         ) tbl
    where rn = 1I found the former to be quicker.
    I think ask tom was saying a lot more, but included something similar,
    Edited by: bluefrog on Jun 10, 2010 12:48 PM

  • Using Windows 7 Professional, as soon at I try to start a system restore, I receive error message "Incorrect function. (0x80070001)" and "Catastrophic failure (0x80000FFFF)." How can I avoid this and perform my system restore?

    Windows Explorer has stopped responding for the most part and I found http://support.microsoft.com/kb/2694911 list of solutions. After working through all of the first options on the list, I tried a system restore three different points
    but got the same two errors: "Incorrect function. (0x80070001)" and "Catastrophic failure (0x80000FFFF)."

    Hi TAS,
    Regarding the error message, I recommend you try to this :
    "0x8000ffff" error message when you try to restore a Windows 7-based computer by using System Restore
    http://support.microsoft.com/kb/2695585/en-us
    If your issue persists, let me known.
    Best regards,
    Karen Hu

  • Aggregation of analytic functions not allowed

    Hi all, I have a calculated field called Calculation1 with the following calculation:
    AVG(Resolution_time) KEEP(DENSE_RANK FIRST ORDER BY RANK ) OVER(PARTITION BY "User's Groups COMPL".Group Name,"Tickets Report #7 COMPL".Resource Name )
    The result of this calculation is correct, but is repeated for all the rows I have in the dataset.
    Group Name      Resourse name    Calculation1
    SH Group            Mr. A            10
    SH Group            Mr. A            10
    SH Group            Mr. A            10
    SH Group            Mr. A            10
    SH Group            Mr. A            10
    5112 rowsI tried to create another calculation in order to have only ONE value for the couple "Group Name, Resource Name) as AVG(Calculation1) but I have the error: Aggregation of analytic functions not allowed
    I saw also inside the "Edit worksheet" panel that the Calculation1 *is not represented* with the "Sigma" symbol I(as for example a simple AVG(field_1)) and inside the SQL code I don't have GROUP BY Group Name, Resource Name......
    I'd like to see ONLY one row as:
    Group Name      Resourse name    Calculation1
    SH Group            Mr. A            10....that it means I grouped by Group Name, Resource Name
    Anyone knows how can I achieve this result or any workarounds ??
    Thanks in advance
    Alex

    Hi Rod unfortunately I can't use the AVG(Resolution_time) because my dataset is quite strange...I explain to you better.
    Ι start from this situation:
    !http://www.freeimagehosting.net/uploads/6c7bba26bd.jpg!
    There are 3 calculated fields:
    RANK is the first calculated field:
    ROW_NUMBER() OVER(PARTITION BY "User's Groups COMPL".Group Name,"Tickets Report Assigned To & Created By COMPL".Resource Name,"Tickets Report Assigned To & Created By COMPL".Incident Id  ORDER BY  "Tickets Report Assigned To & Created By COMPL".Select Flag )
    RT Calc is the 2nd calculation:
    CASE WHEN RANK = 1 THEN Resolution_time END
    and Calculation2 is the 3rd calculation:
    AVG(Resolution_time) KEEP(DENSE_RANK FIRST ORDER BY  RANK ) OVER(PARTITION BY "User's Groups COMPL".Group Name,"Tickets Report Assigned To & Created By COMPL".Resource Name )
    As you can see, from the initial dataset, I have duplicated incident id and a simple AVG(Resolution Time) counts also all the duplication.
    I used the rank (based on the field "flag) to take, for each ticket, ONLY a "resolution time" value (in my case I need the resolution time when the rank =1)
    So, with the Calculation2 I calculated for each couple Group Name, Resource Name the right AVG(Resolution time), but how yuo can see....this result is duplicated for each incident_id....
    What I need instead is to see *once* for each couple 'Group Name, Resource Name' the AVG(Resolution time).
    In other words I need to calculate the AVG(Resolution time) considering only the values written inside the RT Calc fields (where they are NOT NULL, and so, the total of the tickets it's not 14, but 9).
    I tried to aggregate again using AVG(Calculation2)...but I had the error "Aggregation of analytic functions not allowed"...
    Do you know a way to fix this problem ?
    Thanks
    Alex

Maybe you are looking for

  • How can I stream videos from my browers with apple tv to my tv?

    Is it possible to stream the content of my webbrowser,i.e. videos to my tv with Apple tv? in some videos the airplay button appears in some not? Any idea? Or does not work at all? Thx K

  • Backing up iPhoto files to an external hard drive.

    I cannot drag and drop, nor copy and paste photos from iPhoto to an external hard drive, whether as a copy of the complete iPhoto library or as individual photos, nor can I copy/drag a copy of the iPhoto library from the desktop to an external hard d

  • Passing hard code value as the sender name in  fm SO_NEW_DOCUMENT_SEND_API1

    Hi Experts, I am using one FM "SO_NEW_DOCUMENT_SEND_API1" to send mail form my program. In the receipient inbox  under from address the mail is showing the USER ID in which that program has been executed . *Is it possible to send a hard coded value a

  • Error Executing the BPM

    Hi all, I have configured the BPM with WDJ. When execute the BPM i am getting below error, Context data structure of the UI component "com.sap.demo.testui.wd.comp.scrapuicomp.TestUIComp" does not match the data structure known by the task Interface m

  • ADE doesn't support Windows 8

    Hi, After waiting for a week for an answer why I couldn't authentiate my Adode Digital Edition a got an answer from the chat. ADE doesn't support Windows 8!!! http://www.adobe.com/in/products/digital-editions/tech-specs.html If you using Windows 7 64