XML Data template. Using the SUM() function

Hi there,
I have a data template where I want to create a summary column based on the child group.
*<group name="G_RO_ESTIMATES" source="Q_RO_ESTIMATES">
<element name="ESTIMATE_TOTAL" value="G_RO_ESTIMATE_LINES.CHARGE" function="SUM()" />
<group name="G_RO_ESTIMATE_LINES" source="Q_RO_ESTIMATE_LINES">
<element name="CHARGE" value="CHARGE" />
</group>
</group>*
ESTIMATE_TOTAL returns 0
even though the value of the CHARGE column is 760.
I got the SUM() function to work on another group further down in my data template but for some reason this will not work.
Does anyone have a clue on what's wrong?
Thank you in advance.
BR Kenneth

give the name of the element diff as CHARGE_TEST
*<group name="G_RO_ESTIMATES" source="Q_RO_ESTIMATES">
<element name="ESTIMATE_TOTAL_TEST" value="G_RO_ESTIMATE_LINES_GRP.CHARGE_TEST" function="SUM()" />
<group name="G_RO_ESTIMATE_LINES_GRP" source="Q_RO_ESTIMATE_LINES">
<element name="CHARGE_TEST" value="CHARGE" />
</group>
</group>*
sometimes the name get overlapped which results in zero.. keep the names unique
(i guess , i already logged a bug for this sometime back)

Similar Messages

  • Breaking Links to and External Data Connection using the cubevalue() function

    I have spreadsheets that connect to an MSAS cube successfully and pull data in the cells using the CUBEVALUE function.
    Is there a way to perform the equivalent of 'breaking links' to the external database so that the spreadsheet can be distibuted to others that will not have the external database connection set up on their computer/excel environment.
    I find that if i email a spreadsheet with data retreived using cubevalue functions to someone without the external database connection they do not see the values preserved with the spreadsheet and end up with blank or zero cells, etc.
    I have unchecked the box related to 'refresh data when opening file'.
    In a perfect world i would like to remove the db connection and be left with pasted values, similar to breaking links to an external workbook but I am not sure if that is possible.
    I am desperate to find a way to distribute these spreadsheets and be confident that Excel won't be unsuccessfully trying to refresh a connection that isn't on other peoples computer.
    Thanks for any guidance

    Maybe you can upload a sample file to a file sharing site and then share the link with us.
    As you said you have already unchecked the option 'Refresh data when opening the file' within Connection Properties.
    When you send the Excel file to someone without this data connection, they should get the correctly data unless they click the button 'Refresh All'.
    Wind Zhang
    TechNet Community Support

  • How to create Geniric data source using the SAP FUNCTION MODULE

    Hi,
    I want to create genric data source using function module
    MD_STOCK_REQUIREMENTS_LIST_API (delivered by sap)
    for this function module where I can find  Extract Structer
    or I have to create ?
    How can i use this ?
    Thanks in Advance

    Hi Shilpa,
                  Check here..........
    Using function module as the generic extractor
    Generic Delta Update using Function Module
    Document regarding R/3 extractors using function module/user exits
    Generic extractors using FM

  • How to read data after using the PRINT function in visual basic

    I know the benchlink can capture the spectrum analyzer screen for me, but I want to integrate it into my application. I use NI spy to detect the communications from the benchlink and put it into my application. After sending the "PRINT 0" command, my "ilrd SpectrumAnalyzer, temp, 500" command doesn't work, giving me EARG error. Does anyone knows if it is because I can not define the temp to be string or some other problem?
    b.t.w, the communications I get from NI Spy actually read some unknown characters from the instrument, what kind of data it is? Any idea how to use it?
    thanks.

    Hello elm,
    This is completely dependent on your instrument; if you are getting the data then you are halfway there. Look in your instrument's programmer's reference manual to see if they mention how the picture is encoded in bytes. There are so many different ways to encode a picture in binary that speculating and guessing would probably never yield the true result. If there is no mention in the manual, contact the instrument manufacturer.
    Sorry I could not be of more help.
    Scott B.
    Applications Engineer
    National Instruments

  • Is it possible to use an XML Data Template to create a report in APEX?

    Hi,
    I have created an XML Data Template in BI Publisher passing one parameter and running two queries, then created an RTF Document Template to present the data.
    I can create a nice report in BI Publisher using the two elements. I have used RTF Document Templates to publish reports in APEX but the data comes from a Report region running a single query.
    I would like to run a report based in this kind of XML Data Template, in order to use several children queries related to a parent query. Is it possible to do it in APEX, or you have to use BI Publisher?
    Francisco
    ===========================
    Below is a simple data template definition:
    <dataTemplate name="cotizacion_template" description="Prueba de data template para cotizaciones" dataSourceRef="dbxprts">
         <parameters>
              <parameter name="p_id_cotizacion" dataType="character" defaultValue="1009" include_in_output="true"/>
         </parameters>
         <dataQuery>
              <sqlStatement name="header_query">
                   <![CDATA[select id_cotizacion, fecha_cotizacion, id_clipro from f_cotizaciones where id_cotizacion = :p_id_cotizacion]]>
              </sqlStatement>
              <sqlStatement name="detail_query">
                   <![CDATA[select id_cotizacion as id_cot_child, id_detalle_cotizacion, partida, cantidad, id_producto from f_detalle_cotizaciones where id_cotizacion = :id_cotizacion]]>
              </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="F_COTIZACIONES" source="header_query">
                   <element name="ID_COTIZACION" value="ID_COTIZACION"/>
                   <element name="ID_CLIPRO" value="ID_CLIPRO"/>
                   <element name="SUMA_CANTIDAD" value="F_DETALLE_COTIZACIONES.CANTIDAD" function="SUM()"/>
                   <group name="F_DETALLE_COTIZACIONES" source="detail_query">
                        <element name="PARTIDA" value="PARTIDA"/>
                        <element name="CANTIDAD" value="CANTIDAD"/>
                        <element name="ID_PRODUCTO" value="ID_PRODUCTO"/>
                   </group>
              </group>
         </dataStructure>
    </dataTemplate>

    Hi,
    I have the similar question. I used data templates in BI Publisher but now I want to use the same data template in Apex to print some reports.
    I tried to some examples but these were only using report queries. I also tried with the Web Service but this didn't work for me either maybe because I didn't
    used it in the right way. When I used the WS I received the binary of the report so the WS worked it was just the how and where to use it that didn't work for me.
    Now this older entry is BUMPED maybe we find a solution for our problem this way.
    regards,
    Steven

  • Wrong results using the SUM in XPATH- Edit data

    I have a problem when try to do a sum operation using the XPATH function on a set of decimal values:
    To explain it simple, a Service script(also have tried in BPA) which has a edit data step as below
    move '2108.39' to "parm/+listofpay/amt";
    move '1330.8' to "parm/+listofpay/amt";
    move '189.83' to "parm/+listofpay/amt";
    move '4561.12' to "parm/+listofpay/amt";
    move '480.55' to "parm/+listofpay/amt";
    move "sum(parm/listofpay/amt)" to "parm/totamt";
    and the schema is
    <schema>
    <totamt dataType="number"/>
    <listofpay type="list">
    <amt dataType="number"/>
    </listofpay>
    </schema>
    When tried to display(calling through a BPA) the parm/totamt i get a result 8670.68999999999 instead of 8670.69
    Oracle support says it a problem with rounding, how can we have a rounding problem in addition ?
    any suggestions please ?

    Hi Manfred!
    Our setup is very straight forward. We are using a generic M-Series board to generate the stimulus signal as follows:
    Output frequency for x-number of cycles - measure gain/phase response.
    To sample the response, we are using an S-Series board. All of it is done using DAQmx drivers, which again, I don't think makes any difference, since we are experiencing the same problems with a 'pure' software simulation.
    Our unit under test is comprised of a resistor and a capacitor, which represents a simple low pass filter with predictable gain/phase response.
    It appears to us that the erratic phase response at higher frequencies is a result of 1pi versus 2pi phase wrap or flip, which may not be handled correctly by the lock-in tool kit.
    We were thinking of "unwrapping" the phase, but I wanted to find an explanation for this behaviour first, to ensure that we are not dealing with a software bug.
    Also, where can we find the unwrap phase.vi?
    Thanks,
    Markus
    www.movimed.com - Custom Imaging Solutions
    www.movitherm.com - Advanced Thermography Solutions

  • The file should be in XML-DATA-TEMPLATE format

    Hi,
    When I am trying to upload the Data Definition file in XML publisher with EBS 11.5.10.2, I got "The uploaded file GLPAYBDXDO.xml is invalid. The file should be in XML-DATA-TEMPLATE format". I have tried changing the file name to different names including XML-DATA-TEMPLATE but I could not succeed. I appreciate for any help.
    Thanks,
    Ram.

    What is the content of your xml file. Is this sample xml file or Data Template.

  • Sum, total, or count true false data vs using the insert summary

    Please, does someone have specific knowledge on how to count total instances of true or false data vs using the insert summary?
    We have data such as:
         Name          Formula1        Formula2
    Detail level     Bob Barker          True          False
    Detail level     Bob Barker          False          True
    Detail level     Bob Barker          True          False
    Detail level     Bob Barker          True          False
    Group level                    (value)          (value)
    Detail level     Drew Carey          True          True
    Detail level     Drew Carey          False          True     
    Detail level     Drew Carey          False          False
    Group level                    (value)          (value)
    I would like to group by person and run a total in the group level but count only the true data, not every instance.  The insert summary wants to sum all instances formula1 or formula2 whether they are true or false, so Bob Barker will have a value of 4 for formula1 and a value of 4 for formula2 if the insert summary is used.  Our goal is to show Bob having a value of 3 for formula1 and a value of 1 for formula2, only counting the true instances.
    I was unsucessful using the insert summary, running totals, and my  if, then, else formula statements. 
    Any ideas or suggestions?

    Instead of using true/false (which is actually returning a 1 or a 0), try using a formula like this...
    IF {TableName.FieldName} = true condition THEN 1
    Notice there is no ELSE condition, which means that if the formula evaluates to false the result will be a null value. Null values are not included in counts.
    HTH,
    Jason

  • XML Publisher Datasource XML Data Template

    Hello,
    I am trying to create function (Program Units) in my XML Data template, I get the following ERROR.
    XX Custom Application: Version : UNKNOWN
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    XXTESTNEW module: XX TEST Report-New
    Current system time is 13-JUL-2012 15:34:09
    0.197: [GC 0.197: [DefNew: 1777K->191K(1984K), 0.0042507 secs] 1777K->242K(6080K), 0.0043329 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    0.330: [GC 0.330: [DefNew: 1983K->44K(1984K), 0.0054729 secs] 2034K->282K(6080K), 0.0055303 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
    0.536: [GC 0.536: [DefNew: 1836K->192K(1984K), 0.0053814 secs] 2074K->591K(6080K), 0.0054403 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
    0.695: [GC 0.695: [DefNew: 1984K->138K(1984K), 0.0036150 secs] 2383K->711K(6080K), 0.0036667 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
    0.969: [GC 0.969: [DefNew: 1930K->92K(1984K), 0.0050182 secs] 2503K->802K(6080K), 0.0050735 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
    1.453: [GC 1.453: [DefNew: 1884K->192K(1984K), 0.0049133 secs] 2594K->1247K(6080K), 0.0049730 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
    1.493: [GC 1.493: [DefNew: 1962K->58K(1984K), 0.0025240 secs] 3018K->1301K(6080K), 0.0025808 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
    1.501: [GC 1.501: [DefNew: 1847K->93K(1984K), 0.0014896 secs] 3090K->1337K(6080K), 0.0015390 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    1.507: [GC 1.507: [DefNew: 1860K->70K(1984K), 0.0006978 secs] 3103K->1313K(6080K), 0.0007453 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    1.514: [GC 1.514: [DefNew: 1849K->103K(1984K), 0.0004474 secs] 3093K->1346K(6080K), 0.0004883 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    1.595: [GC 1.596: [DefNew: 1895K->138K(1984K), 0.0020285 secs] 3138K->1437K(6080K), 0.0020863 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
    1.673: [GC 1.673: [DefNew: 1930K->64K(1984K), 0.0014510 secs] 3229K->1496K(6080K), 0.0015049 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    1.759: [GC 1.759: [DefNew: 1856K->98K(1984K), 0.0014301 secs] 3288K->1530K(6080K), 0.0014835 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    1.827: [GC 1.827: [DefNew: 1890K->89K(1984K), 0.0010782 secs] 3322K->1572K(6080K), 0.0011340 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    1.880: [GC 1.880: [DefNew: 1881K->133K(1984K), 0.0011918 secs] 3364K->1616K(6080K), 0.0012450 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    1.936: [GC 1.936: [DefNew: 1925K->113K(1984K), 0.0012641 secs] 3408K->1670K(6080K), 0.0013197 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    1.990: [GC 1.990: [DefNew: 1905K->191K(1984K), 0.0022812 secs] 3462K->1976K(6080K), 0.0023401 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
    XDO Data Engine Version No: 5.6.3
    Resp: 23202
    Org ID : 43
    Request ID: 22637028
    All Parameters:
    Data Template Code: XXTESTNEW
    Data Template Application Short Name: XX
    Debug Flag: N
    2.161: [GC 2.161: [DefNew: 1983K->192K(1984K), 0.0036382 secs] 3768K->2170K(6080K), 0.0036949 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
    Calling XDO Data Engine...
    2.289: [GC 2.289: [DefNew: 1984K->192K(1984K), 0.0036540 secs] 3962K->2475K(6080K), 0.0037115 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    [071312_033411511][][EXCEPTION] java.lang.NullPointerException
         at oracle.apps.xdo.dataengine.DataTemplateParser.GetNodeNumChildren(DataTemplateParser.java:334)
         at oracle.apps.xdo.dataengine.DataTemplateParser.templateParser(DataTemplateParser.java:266)
         at oracle.apps.xdo.dataengine.XMLPGEN.setDataTemplate(XMLPGEN.java:140)
         at oracle.apps.xdo.dataengine.DataProcessor.setDataTemplate(DataProcessor.java:193)
         at oracle.apps.xdo.oa.util.DataTemplate.<init>(DataTemplate.java:245)
         at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:282)
         at oracle.apps.fnd.cp.request.Run.main(Run.java:161)
    2.394: [GC 2.394: [DefNew: 1365K->143K(1984K), 0.0025966 secs]2.397: [Tenured: 2451K->2381K(4096K), 0.0798821 secs] 3648K->2381K(6080K), 0.0825759 secs] [Times: user=0.08 sys=0.01, real=0.08 secs]
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
         at com.sun.java.util.collections.ArrayList.RangeCheck(ArrayList.java:492)
         at com.sun.java.util.collections.ArrayList.get(ArrayList.java:306)
         at oracle.apps.xdo.dataengine.DataTemplateParser.getParentDataSource(DataTemplateParser.java:1796)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeDefaultGroup(XMLPGEN.java:331)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeGroupStructure(XMLPGEN.java:286)
         at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:273)
         at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:215)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:254)
         at oracle.apps.xdo.dataengine.DataProcessor.processDataStructre(DataProcessor.java:390)
         at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:355)
         at oracle.apps.xdo.oa.util.DataTemplate.processData(DataTemplate.java:348)
         at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:293)
         at oracle.apps.fnd.cp.request.Run.main(Run.java:161)
    Heap
    def new generation total 1984K, used 250K [0xcc400000, 0xcc620000, 0xccb10000)
    eden space 1792K, 13% used [0xcc400000, 0xcc43ea98, 0xcc5c0000)
    from space 192K, 0% used [0xcc5c0000, 0xcc5c0000, 0xcc5f0000)
    to space 192K, 0% used [0xcc5f0000, 0xcc5f0000, 0xcc620000)
    tenured generation total 6104K, used 4381K [0xccb10000, 0xcd106000, 0xd0400000)
    the space 6104K, 71% used [0xccb10000, 0xccf57598, 0xccf57600, 0xcd106000)
    compacting perm gen total 12288K, used 7039K [0xd0400000, 0xd1000000, 0xd8400000)
    the space 12288K, 57% used [0xd0400000, 0xd0adfc88, 0xd0adfe00, 0xd1000000)
    ro space 8192K, 80% used [0xd8400000, 0xd8a73430, 0xd8a73600, 0xd8c00000)
    rw space 12288K, 59% used [0xd8c00000, 0xd9330510, 0xd9330600, 0xd9800000)
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    Executing request completion options...
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 13-JUL-2012 15:34:11
    Please see the following Data Template, I have copied the folloing
    <report name="anyname" DTDVersion="9.0.2.0.0">
    <data>
    <dataSource name="Q_1">
    <select>
    select 1 EMPLOYEE_ID, 'FIRST_NAME' FIRST_NAME,'LAST_NAME' LAST_NAME, 1 DEPARTMENT_ID ,2 SALARY, 2 COMMISSION_PCT from dual
    </select>
    <group name="G_EMPLOYEES">
    <dataItem name="EMPLOYEE_ID"/>
    <dataItem name="FIRST_NAME"/>
    <dataItem name="LAST_NAME"/>
    <dataItem name="HIRE_DATE"/>
    <dataItem name="SALARY"/>
    <dataItem name="COMMISSION_PCT"/>
    <dataItem name="DEPARTMENT_ID"/>
    <formula name="CF_REMUNERATION" source="cf_1formula"
    datatype="number" width="20" precision="10"/>
    </group>
    </dataSource>
    <summary name="CS_REPORT_LEVEL_SUMMARY" function="sum" width="20"
    precision="10" reset="report" compute="report"/>
    </data>
    <programUnits>
    <function name="cf_1formula" returnType="number">
    <textSource>
    <![CDATA[
    function CF_1Formula return Number is
    begin
    return (:salary + nvl(:commission_pct,0));
    end;
    ]]>
    </textSource>
    </function>
    </programUnits>
    </report>
    Note:
    I have taken this from the following documentation.
    http://docs.oracle.com/cd/E12839_01/bi.1111/b32121/pbr_xml003.htm
    Regards
    Ed

    Hi,
    To me it seems that format is used in BI Publisher usined iN OBI and not Oracle XML Publisher.
    Why dont you try to get the value in sql itself like (:salary + :pct_cimssion) as abcd

  • How to use the set functions effectively in webi ,please let me know with detail

    how to use the set functions effectively in webi ,please let me know with detail

    Hi,
    we use use set functions on heirarchies with aggregate functions mostly .
    If you include member_set, Min returns the minimum value of the aggregated data for all members in the member set.
    Member_set can include multiple sets separated by semicolons (;).
    The list of member sets must be enclosed in {}.
    If the member set expression does not specify a precise member or node, the hierarchy referenced must be present in the table, then the member set expression references the current member in the hierarchy in the table. If the hierarchy is not in the table, the function returns the message #MULTIVALUE.
    Eg .
    1)     Ancestor
    =Sum([YTD] ; {Ancestor([Test Hierarchy];2)})
    2)     IsLeaf
    =[Test Hierarchy].IsLeaf
    You can use this function when you want to show your Measure only at lower level .
    3)     .Depth
    =[Test Hierarchy].Depth
    This is also function used with hierarchy to find Level of Members .
    Follow this link for PDF reference .
    Page 147
    https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&ved=0CDIQFjAB&url=https%3A%2F%2Fhelp.sap.com%2Fbusinessobject%2Fproduct_guides%2Fboexir4%2Fen%2Fxi4sp5_ffc_en.pdf&ei=nBAUU-iUM4WWrAeMuoCoDg&usg=AFQjCNHakXsEjd_yUk2y3lVdibf3PXpEOA&bvm=bv.61965928,d.bmk
    search on SCN this question was discussed before also one those links .
    http://scn.sap.com/thread/3183380
    Hope this will help you .

  • Using the ssIncludeXml function in Site Studio 10gR4

    Since the managed data file format has changed dramatically in Site Studio 10gR4, how do I still use ssIncludeXml to extract a particular element?
    For example, a data file in Site Studio 10gR3 looks similar to this:
    <region1>
    <PageBody>
    </PageBody>
    </region1>
    To extract the "PageBody" element I would use the ssIncludeXml function like this:
    ssIncludeXml(dDocName,"region1/PageBody/node()")
    In Site Studio 10gR4 a typical data file format looks like this:
    <wcm:root>
    <wcm:element name="PageBody">
    </wcm:element>
    </wcm:root>
    How do I use the ssIncludeXml function to match the "PageBody" here?
    Thanks!

    I'm trying to do this in Site Studio 11g and am having zero luck. I have an HCSP in Site Studio [which I am using to write XML] that is querying the system and returning a set of XML data files. In my HSCP, I have
    <link><!--$$ssIncludeXml(dDocName, "wcm:root/wcm:element\[@name='url'\]/text()")--></link>
    The XML documents' format is
    <wcm:root version="8.0.0.0">
    <wcm:element name="metadata"/>
    <wcm:element name="url">http://www.cnn.com</wcm:element>
    <wcm:element name="thumbnail"><img src="/cs/groups/internal/documents/digitalmedia/mdaw/mdex/~edisp/cf_12_831_ivolunteers_3_.jpg" alt="ivolunteers" /></wcm:element>
    <wcm:element name="text">This is my link text</wcm:element></wcm:root>
    When I run this, however, I get nothing returned (no errors either).
    Frustration! :) Any ideas?

  • Need XML data template info

    We are using a xml data template that generates an output file which is also a .xml... how can I archive this output file by making changes in the data template xml.

    Edit the query in data template

  • The sum function requires 1 argument(s).

    ---Hi i am trying get all of
    (sum(Q.SCTOTAL,0)) as SC,
    (sum(Q.SRTOTAL,0)) as SRTOTAL,
    (sum(Q.CminusREF,0))as CminusREF,
    (sum(Q.SFAT,0))as SFAT,
    (sum(Q.SPAT,0))as SPAT,
    (sum(Q.SNOTATPT,0))as SNOTATPT,
    (sum(Q.SET,0))as SET,
    (sum(Q.TOTAV,0))as TOTAV
    and for each emp_name?
    but it is not wotking for me. the error says: The sum function requires 1 argument(s).
    what shoould i change on the code below so mY Query can Run?
    thank you
    B.
    select distinct
    G.Emp_name,
    upper(G.EMP_case_number) as MIS_EMP_case_NO,
    G.Emp_name as Emp,
    G.MIS_Emp_id,Radius,
    G.address,
    G.DC as Emp_DC,
    G.Emp_class,
    Q.YEAR,
    Q.EMP_case_number,
    (sum(Q.SCTOTAL,0)) as SC,
    (sum(Q.SRTOTAL,0)) as SRTOTAL,
    (sum(Q.CminusREF,0))as CminusREF,
    (sum(Q.SFAT,0))as SFAT,
    (sum(Q.SPAT,0))as SPAT,
    (sum(Q.SNOTATPT,0))as SNOTATPT,
    (sum(Q.SET,0))as SET,
    (sum(Q.TOTAV,0))as TOTAV
    FROM tbl_MIS_QC G
    LEFT JOIN QCPFA Q ----View
    ON upper(Q.EMP_case_number) = upper(G.EMP_case_number)
    where DC = '55'
    gorup by G.Emp_name
    order by G.Emp_name, upper(G.EMP_case_number)

    Hi,
    It's true: the SUM function only takes one argument. What are you trying to do with the second argument, 0?
    When you use aggregate functions (like SUM), everything in the SELECT clause must be an aggregate function, a constant, or one of the GROUP BY columns. Without knowing your tables, your data, or what results you want, I can't tell you exactly what to do. You might want to compute the SUMs in a sub-query before joining them to the other table, something like this:
    select  G.Emp_name,
            upper(G.EMP_case_number) as MIS_EMP_case_NO,
            G.Emp_name as Emp,
            G.MIS_Emp_id,Radius,
            G.address,
            G.DC as Emp_DC,
            G.Emp_class,
            Q.YEAR,
            Q.upper_EMP_case_number,
            q.sc,
            q.srtotal,
    FROM    tbl_MIS_QC G
    LEFT JOIN
            (   -- Begin in-line view q
            SELECT  year,
                    UPPER (emp_case_number) AS upper_emp_case_number,
                    sum(SCTOTAL) as SC,
                    sum(SRTOTAL) as SRTOTAL,
            FROM    QCPFA
            GROUP BY  year,
                      UPPER (emp_case_number)
            )   -- End in-line view q
    ON Q.upper_EMP_case_number = upper(G.EMP_case_number)
    where DC = '55'
    order by G.Emp_name, upper(G.EMP_case_number) Repeat: this is just a wild guess, the best I can do without seeing some test data and the results you want from that data.

  • Parameter Passing from Concurrent Program to XML Data Template

    Hi All,
    I have a xml data template which is attached to a data definition. The data template contains a SQL query and some parameter definitions. One of the parameters is p_emp_id. The data type of the parameter is "number" and the where clause that uses the parameter is as follows:
    AND employee_id in (:p_emp_id,DECODE(:p_emp_id,126,130,-99).
    The data definition is attached to a concurrent program which has a parameter based on a valueset. Format type of valueset is char. Validation type is table. Inside the table definition, the table is employees. value column is emp_name type is char. meaning column is emp_name type is char. ID column is emp_id type is number.
    The above where clause condition fails when the conc program is run. In the log file I can see that the value passed is 126 from the valueset. If the query is run independently in TOAD and value passed is 126, the where clause returns rows.
    Kindly let me know what could be the possible issue. Let me know if the question is not clear enough.
    Thanks,
    Amit

    Hi Ashish,
    Thanks for replying.
    I mentioned that the Id column of the VSet is emp_id right ? Isn't the Id column value passed ?
    Moreover I also mentioned that I could see in the log file that the emp_id value is being passed and not the name. I could see in the log file p_emp_id=126. There seems to be some problem with the data types and all.
    Thanks,
    Amit

  • Inverse of the Sum function

    Post Author: deejayw
    CA Forum: Formula
    Hi,I am trying to create a formula which works like the Sum function but will give me the difference between two amounts.Scenario:Each record has a username, invoice date and invoice amount. My data set contains two months of data which means for each username, i have two invoice amounts and invoice dates. I know the Sum function will add values together but how can i get the difference between two values, namely last months invoice amount and this months invoice amount (order is important).Do i need to use an array or is my brain so fried that i'm missing something simple?Thanks 

    Post Author: satyanat
    CA Forum: Formula
    Hi,
    Instead of having the two months invoice details in a single query you can write it as two queries, one to pull the current month invoice date,amount and the other one to pull the previous month Invoice. you can link both queries on User name through visual link.
    Now you can easily find the difference between the two invoice amounts.
    ex: {previousmonth.invoiceamt} - {currentmonth.invoiceamt}
    Try this option.
    Regards,
    Natarajan

Maybe you are looking for

  • Videos won't play in iTunes

    TV, Video Podcast, Movies - none of them play in iTunes 10.5.3.  A windows pops up, you have the PAUSE button showing as if it's playing but nothing is happening, just a still shot of the video.  They play fine in quicktime. I re-installed iTunes, no

  • Cannot change "Open with" (in context menu) from CS3 to CS6

    I have CS5 and CS6 installed, and now I've also installed CS3 (because of problems with ps actions that does not work properly), and in the context menu "Open with", "Open" and "Edit" now starts CS3 instead of CS6. How change all that to CS6? Note: w

  • Computer monitor problem

    I have started having problems with the monitor on my desk top.  I can run all operations in safe mode then when it goes to standard run mode, the screen goes black.  During startup I notice that there is a screen full of little bullet looking things

  • Error executing a query using VPD and BC4J

    Hi all, Our team is developing an application using an Oracle DB 9.2.0.4 and BC4J 10g (9.0.5.16.0) as persistence layer. We also are using the VPD (virtual private database) to have security in the database at row level. The problem we are facing is

  • Bbm working but emails not working

    i have just changed my BB and transferred all data using desktop manager to my new blackberry curve. My BBM has started wroking, but emails are not working. Need urgent help on this...