How to use total/sum of values obtaind by applying formula on restricted KF

Hi all
I am using formula on restricted keyfigure i.e I want to apply formula on quantity for particular material say 100007,100990.I want to use total of values in some other formula,obtained by aaplyin formula on their respective quantities(obtained by using restricted keyfigure). if I use SUMCT or SUMGT it is not taking total of these 2 values instead taking value obtained by applying formula on result row.
Is there any other way to use this 'total ' value in some other formula
KIindly help
Regards
Megha

have you tried: key figure properties -> calculations -> calculation directions
hope it helps,
Leo

Similar Messages

  • How to use Groovy sum function in JDev11g

    In Fusion developer guide: 3.6 Overview of Groovy Support
    Says you can use the following built-in aggregate functions on ADF RowSet objects:
    ■ rowSetAttr.sum(GroovyExpr)
    ■ rowSetAttr.count(GroovyExpr)
    ■ rowSetAttr.avg(GroovyExpr)
    ■ rowSetAttr.min(GroovyExpr)
    ■ rowSetAttr.max(GroovyExpr)
    Have see a couple of threads that deal with this topic but neither say how to explicitly do this.
    I created a VO (EmpView1) and added a transient variable empSum, and set it to the expression EmpView1.sum("Sal") also rowSetAttr.sum("Sal") and get the following error.
    (oracle.jbo.expr.JIEvalException) JBO-25077: Name EmpView1 not found in the given object: ViewRow [oracle.jbo.Key[7839 ]].
    Really do need to find out how to use these functions.
    Thanks - Casey

    Hi,
    here's a little tutorial
    - create a master/detail relation between Departments and Employees using the HR schema
    - For the Departments VO, create a RowImpl class from the Java section
    - create an attribute SumFromEO in the Departments EO
    - in the DepartmentsVO, create a new attribute from EO pointing to SumFromEO
    - Also, in the VO, create a new attribute SumFromVO
    - make sure the attribue is transiesnt
    - set the created attribute on the VO "SumFromVO" and "SumFromEO" to use an Expression
    - Add the following Groovy expression to the SumFromEO transient attribute on the EO
    adf.object.Employees1.sum("Salary");
    - Add the following Groovy expression to the SumFromVO transient attribute on the VO
    adf.object.EmployeesView.sum("Salary");
    When you run this then both, the EO based VO attribute and the VO attribute should show the same value
    Frank

  • How to get total sum of big filtered table?

    Hello
    I'm using JDeveloper 11.1.1.3.0
    I have an af:table with big data source (100 000 rows). The table have filters.
    I want to display total count of the filtered rows and total sum by the one of column of the filtered rows in the footer of the table.
    In my backing bean I can get a Map with all filter values:
    Map<String, Object> filters = ((FilterableQueryDescriptor)table.getFilterModel()).getFilterCriteria();And, in this case, I may create the method for getting sum I need on my own.
    In this method I may create SQL Query dynamically, because I have to process all filter values with different types
    It is possible, but, maybe, there is a more easy way to do it?
    Anatolii

    Hi, sanchezis
    Code example.
    In the jsp:
                    <af:column sortProperty="Sumv" sortable="true" filterable="false" align="end" width="125px"
                               headerText="#{bindings.TransactionView1.hints.Sumv.label}" id="c16">
                      <af:outputText value="#{row.Sumv}" id="qt4">
                        <af:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
                      </af:outputText>
                      <f:facet name="footer">
                          <af:panelGroupLayout id="pg41" halign="right"
                                               layout="vertical">             
                        <af:outputText value="#{backing_reptransactions.tableTransactionTotalSumV}" id="ot44">
                          <af:convertNumber maxFractionDigits="2" minFractionDigits="2"/>
                        </af:outputText>
                        </af:panelGroupLayout>
                      </f:facet>
                    </af:column>In the backing bean:
        public double getTableTransactionTotalSumV() {
            DCIteratorBinding iter =
                binding.findIteratorBinding("TransactionView1Iterator");
            TransactionViewImpl vo = (TransactionViewImpl)iter.getViewObject();
            return vo.getFilteredTotalSumV();
        }In the ViewImpl (TransactionViewImpl) class.
        public double getFilteredTotalSumV() {
            double sumV = 0d;
            DBTransaction dbTransaction = getDBTransaction();
            ResultSet rs = null;
            String query = "SELECT SUM(SumV) sumvtotal FROM (" + getQuery() + ")";
            String str1 = "WHERE ROWNUM < :Bind_RangePage_High";
            String str2 = "WHERE Z_R_N > :Bind_RangePage_Low";
            int i = query.indexOf(str1);
            if (i > 0) {
                query = query.substring(0, i) + " " + query.substring(i + str1.length());
            i = query.indexOf(str2);
            if (i > 0) {
                query = query.substring(0, i) + " " + query.substring(i + str2.length());
            PreparedStatement st = dbTransaction.createPreparedStatement(query, 0);
            try {
                Object[] params = this.getWhereClauseParams();
                int index = 0;
                for (Object avalue : params) {
                    String key = (String)((Object[])avalue)[0];
                    if ((!key.equals("Bind_RangePage_High")) &&
                        (!key.equals("Bind_RangePage_Low"))) {
                        Object value = ((Object[])avalue)[1];
                        index++;
                        if (value instanceof Integer) {
                            st.setInt(index, (Integer)value);
                        } else if (value instanceof oracle.jbo.domain.Date) {
                            st.setDate(index,
                                       ((oracle.jbo.domain.Date)value).dateValue());
                        } else if (value instanceof java.sql.Date) {
                            st.setDate(index, (Date)value);
                        } else {
                            st.setString(index, (String)value);
                rs = st.executeQuery();
                if (rs.next()) {
                    sumV = rs.getDouble("sumvtotal");
            } catch (SQLException e) {
                throw new JboException(e);
            } finally {
                if (st != null) {
                    try {
                        st.close();
                    } catch (SQLException e) {
            return sumV;
        public long getFilteredTotalCount() {
            return this.getEstimatedRowCount();
        }But, you need to know that in the TransactionView in the "General" - "Tuning" I set up next values:
    "All rows",
    "As needed",
    "Fill Last Page of Rows when Paging through Rowset",
    "Passivate State(..."
    Access Mode - "Range Paging Incremental"
    Range Size - 160
    Range Paging Cache Factor - 3
    If you have other values, then your SQL request may be different, so, you will have to rewrite it.
    I talk about
    "WHERE ROWNUM < :Bind_RangePage_High",
    "WHERE Z_R_N > :Bind_RangePage_Low",
                    if ((!key.equals("Bind_RangePage_High")) &&
                        (!key.equals("Bind_RangePage_Low")))If you have other solution, please, tell me.
    Anatolii

  • Can VLOOKUP, OFFSET, INDEX and MATCH be used to SUM the value of cells from multiple tables?

    I have a problem thats needs a sulution. I have a Spreadsheet with multiple sheets and tables. The (Truck ) Sheets each represent a "Site" and the tables within from 1-31 show inventory counts for each day of the month.
    Shown below are Edited example's of a "Site" sheet and the Day tables contained within it.
    The Spreadsheet expands as a new "Site" (Truck ) is added regularly. Currently there are 30 "Sites" (Trucks).
    Also within the spreadsheet is a sheet (Checkpoint) which contains tables used to show summary data for each "Site" sheet. There is one table used to review one site, so currently there are 30 tables identical in format and structure reviewing 30 sites.
    An edited example of the summary table for Truck 1 is shown below.
    The table's in CP reference data within cells from other sheets. A LEN INDIRECT formula
    =IF(LEN(INDIRECT("Truck 1::Day "&COLUMN(cell)−3&"::K53",addr-style))<1,"",INDIRECT("Truck 1::Day "&COLUMN(cell)−3&"::k53",addr-style))
    was used to retrieve the values within certain cells. This formula works perfectly because when I add another "Site" I simply need to Dupicate a "Site" Template Sheet and then Copy Paste the LEN INDIRECT formula in to the newly created Summary table. 
    There is another sheet (Command Central) which contains a Master summary table. The Master Summary sheet is identical in structure to the CP Summary Tables. Its purpose is to show the combined data from the tables within Checkpoint (Truck 1-30). for instance MS::D5=Checkpoint::Truck 1:Truck 30::D5. I realize that Numbers cannot calculate cells within a range of table so I am hoping for a workaround. 
    Could someone please help me with a formula something like the LEN INDIRECT formula mentioned above or possible a something else that could work beside
    D5=Truck 1::D5,Truck 2::D5,Truck 3::D5...?
    When I use that formula type I will have to edit the formula every time I add a new site.
    Anothe issue Im having is getting D3:AH3 to show the correct count of names. I am using the following formula:
    D3=SUM(COUNTA(Truck 1::D3,Truck 2::D3,Truck 3::D3,Truck 4::D3))−SUM(COUNT(UNION.RANGES(Truck 1::D3,Truck 2::D3,Truck 3::D3,Truck 4::D3)))
    The cells it is counting are either blank (the refenced cell contains a LEN INDIRECT formula that places "" if needed) or contain a name. This formula works when I and addressing cells without the LEN INDIRECT formula. What am I doing wrong?

    Hello Wayne,
    Here are screenshots of the tables in question. The first on is the Master summary table.
    Cell D5 shows the value pulled from Checkpoint::Truck 1::D5
    Cell E5 shows the value pulled from Checkpoint::Truck 2::D5
    Cell F5 shows the value pulled from Checkpoint::Truck 3::D5
    Cell G5 shows the value pulled from Checkpoint::Truck 4::D5

  • How to use Oracle Table Type values in Select Statement.

    Hi,
    I am fetching initial set of values into Oracle Table of Records Type and want to use list of values in the Select statement.
    For example, try something like the following:
    TYPE t_record IS RECORD (
    ID TABLEA.ID%type,
    NO TABLEA.NO%type,
    v_record t_record;
    TYPE t_table IS TABLE OF v_record%TYPE;
    v_table t_table;
    -- Code to populate the values in v_table here.
    SELEC ID,NO, BULK COLLECT INTO <some other table variabes here> FROM TABLEA
    WHERE ID IN v_table(i).ID;
    I want to know how to use the values from Oracle Table Type in the Select Statement.

    Something like this:
    create or replace type t_record as  object (
    id number,
    no number
    CREATE or replace type t_table AS TABLE OF t_record;
    set serveroutput on
    declare
      v_table t_table := t_table();
      v_t1 t_table := t_table();
    begin
      v_table.extend(1);
      v_table(1).ID := 1;
      v_table(1).No := 10;
      v_table.extend(1);
      v_table(2).ID := 2;
      v_table(2).ID := 20;
      SELEC t_record (ID,NO) BULK COLLECT INTO v_t1
      from TableA
      FROM TABLEA
      WHERE ID IN (select t.ID from table(v_Table) t);
      for i in 1..v_t1.count loop
        dbms_output.put_line(v_t1(i).ID);
        dbms_output.put_line(v_t1(i).No);
      end loop;
    end;
    /Untested!
    P;
    Edited by: bluefrog on Mar 5, 2010 5:08 PM

  • How to use a parameter field value as a substring in a "like" statement?

    Hi all,
    I'm trying to use a parameter field in a Record selection formula where the parameter field value would be a substring of the data stored in the field.
    My parameter field (SlctResearcher) is constructed as follows:
    Type: string
    List of Values: static
    Value Field: (Reports) RptAuthors
    (in Value Options) Allow custom values?: True
    {Reports.PubDate} in DateTime (2009, 04, 01, 00, 00, 00) to DateTime (2010, 03, 31, 23, 59, 59) and
    {Reports.RptAuthors} like "*{?SlctResearcher}*"
    When I hit F5 to generate the data, I get no results (and the parameter prompt field does not even come up...)
    If I modify the formula to put a hard-coded string, like
    "*Jones*"
    after the 'like', I get results (all the reports where "Jones" is a substring in the RptAuthors string.) If I modify the formula to just use the parameter field without the quotes/stars like:
    {Reports.PubDate} in DateTime (2009, 04, 01, 00, 00, 00) to DateTime (2010, 03, 31, 23, 59, 59) and
    {Reports.RptAuthors} like {?SlctResearcher}
    I do get the parameter prompt field, but still no results even if I put in a valid substring value (since it is not searching for a substring anymore...)
    How can I do this?
    Thanks,
    Will

    1st thing... Make a copy of your report before doing anything!!!
    To use a SQL Command, you'll want to open the Database Expert and look at the Current Connections. Expand the data source and the 1st option you see is the Add Command option.
    To find the SQL That CR is currently using, choose Database from the menu bar and select Show SQL Query...
    You can copy this and paste it directly into the command window. (If you you can write your own SQL you don't need copy CR's, it's just an option.)
    You'll also want to take not of any parameters that you have, you'll need to add them the the Parameter List of the command as well... be sure to spell them EXACTLY as they are in the design pane.
    Anyway, once the SQL statement is in the Command window you'll be able to alter the WHERE clause to use the wild cards.
    For future reference... What type of database are you reporting against???
    Jason

  • How to use the same variable value for data entry and the planning sequence

    Hi,
    the scenario is the following:
    Using the WAD template a user enters cost center plan data. The cost center is selected by the chosen value for the variable "V1".
    Afterwards he shall push a button which starts a planning sequence (including saving the data and further functions). This planning sequence uses a filter that also contains the variable "V1".
    What or where has it to be defined that the planning sequence uses automatically the same value for the variable "V1" as selected for the data entry?

    You have to define in the planning function. The planning sequence is only a sequence and it read the planning functions underneath it.
    Ravi Thothadri

  • BSEG table value can't apply formula

    I download amount column for BSEG into excel, for example, in excel, the document number 400000235 has amount 51.866,60,
    when I apply formula column X=1.5*amount column, it shows #value!, if I change to 51866.6, it works fine, I have more than 2000 lines to change, I can't do it one by one, any one got idea how to fix this issue. thanks

    Hi,
    before you make the download from SAP, change the user parameters in su3 transaction (Defaults / decimal notation) to the decimal notation you need (eg. from xxx.xxx,yy to xxx,xxx.yy) . In MS Excel, you can try to do the same and convert the figures to values by using the formula "value" but the easier way is to change the setting in the source system.
    Best regards, Christian

  • How to use Ajax Get Multiple Values in Tabular form?

    Hi All-
    I am trying to use AJAX to get multiple values in tabular form by using Denes Kubicek's example in the following link -
    http://apex.oracle.com/pls/otn/f?p=31517:239:9172467565606::NO:::
    Basically, I want to use the drop down list to populate rest of the values on the form.
    I have created the example(Ajax Get Multiple Values, application 54522) on Oracle site -
    http://apex.oracle.com/pls/apex/f?p=4550:1:0:::::
    Workspace: iConnect
    login: demo
    password: demo
    I was able to duplicate his example on page 1 (home page).
    However, I want to use system generate tabular form to finish this example, and was not able to populate the data correctly.
    Page 2 (method 2) is the one that I am having trouble to populate the column values. When I checked application item values in Session, and the values seems to be populated correctly.
    This is what I have done on this page:
    1. Create an Application Process On Demand - Set_Multi_Items_Tabular2:
    DECLARE
      v_subject my_book_store.subject%TYPE;
      v_price my_book_store.price%TYPE;
      v_author my_book_store.author%TYPE;
      v_qty NUMBER;
      CURSOR cur_c
      IS
      SELECT subject, price, author, 1 qty
      FROM my_book_store
      WHERE book_id = :temporary_application_item2;
    BEGIN
      FOR c IN cur_c
      LOOP
      v_subject := c.subject;
      v_price := c.price;
      v_author := c.author;
      v_qty := c.qty;
      END LOOP;
      OWA_UTIL.mime_header ('text/xml', FALSE);
      HTP.p ('Cache-Control: no-cache');
      HTP.p ('Pragma: no-cache');
      OWA_UTIL.http_header_close;
      HTP.prn ('<body>');
      HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
      HTP.prn ('<item id="f04_' || :t_rownum || '">' || v_subject || '</item>');
      HTP.prn ('<item id="f05_' || :t_rownum || '">' || v_price || '</item>');
      HTP.prn ('<item id="f06_' || :t_rownum || '">' || v_author || '</item>');
      HTP.prn ('<item id="f07_' || :t_rownum || '">' || v_qty || '</item>');
      HTP.prn ('</body>');
    END;
    2. Create two application items - TEMPORARY_APPLICATION_ITEM2, T_ROWNUM2
    3. Put the following in the Page Header:
    <script language="JavaScript" type="text/javascript">
    function f_set_multi_items_tabular2(pValue, pRow){
        var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=Set_Multi_Items_Tabular2',0);
    if(pValue){
    get.add('TEMPORARY_APPLICATION_ITEM2',pValue)
    get.add('T_ROWNUM2',pRow)
    }else{
    get.add('TEMPORARY_APPLICATION_ITEM2','null')
        gReturn = get.get('XML');
        if(gReturn){
            var l_Count = gReturn.getElementsByTagName("item").length;
            for(var i = 0;i<l_Count;i++){
                var l_Opt_Xml = gReturn.getElementsByTagName("item")[i];
                var l_ID = l_Opt_Xml.getAttribute('id');
                var l_El = html_GetElement(l_ID);   
                if(l_Opt_Xml.firstChild){
                    var l_Value = l_Opt_Xml.firstChild.nodeValue;
                }else{
                    var l_Value = '';
                if(l_El){
                    if(l_El.tagName == 'INPUT'){
                        l_El.value = l_Value;
                    }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
                        l_El.parentNode.innerHTML = l_Value;
                        l_El.parentNode.id = l_ID;
                    }else{
                        l_El.innerHTML = l_Value;
        get = null;
    </script>
    Add the follwing to the end of the above JavaScript:
    <script language="JavaScript" type="text/javascript">
    function setLOV(filter, list2)
    var s = filter.id;
    var item = s.substring(3,8);
    var field2 = list2 + item;
    f_set_multi_items_tabular2(filter, field2);
    4. Tabular form query:
    select
    "BOOK_ID",
    "BOOK",
    "SUBJECT",
    "PRICE",
    "AUTHOR",
    "QTY",
    "BOOK_ID" BOOK_ID_DISPLAY
    from "#OWNER#"."MY_BOOK_STORE"
    5. In Book_ID_DISPLAY column attribute:
    Add the following code to element attributes: onchange="javascript:f_set_multi_items_tabular2(this.value,'#ROWNUM#');"
    Changed to -> onchange="javascript:setLOV(this,'f03');"
    Now,  T_ROWNUM2 returns value as f03_0001. But, TEMPORARY_APPLICATION_ITEM2 returns as [object HTMLSelectElement]...
    Please help me to see how I can populate the data with this tabular form format. Thanks a lot in advanced!!!
    Ling
    Updated code in Red..

    Ling
    Lets start with looking at what the javascript code is doing.
    function f_set_multi_items_tabular(pValue, pRow){
      /*This will initiate the url for the demand process to run*/
      var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
                              'APPLICATION_PROCESS=Set_Multi_Items_Tabular',0);
      if(pValue){
        /*If there is an value than submit item name with value*/
        get.add('TEMPORARY_APPLICATION_ITEM',pValue)
        get.add('T_ROWNUM',pRow)
      }else{
        /*Else set the item TEMPORARY_APPLICATION_ITEM to null*/
        get.add('TEMPORARY_APPLICATION_ITEM','null')
      /*Submit the url and te returned document is of type XML*/
      gReturn = get.get('XML');
      if(gReturn){
        /*There is something returned*/
        var l_Count = gReturn.getElementsByTagName("item").length;
        /*For all elements of the tag item*/
        for(var i = 0;i<l_Count;i++){
          /*Get the item out of the XML*/
          var l_Opt_Xml = gReturn.getElementsByTagName("item")[i];
          /*Get the id of the item*/
          var l_ID = l_Opt_Xml.getAttribute('id');
          /*Get the element in the original page with the same id as
          **the item we have in the XML produced by the ondemand process
          var l_El = html_GetElement(l_ID);
          /*Now get the value of the item form the XML*/
          if(l_Opt_Xml.firstChild){
            var l_Value = l_Opt_Xml.firstChild.nodeValue;
          }else{
            /*There is no value*/
            var l_Value = '';
          if(l_El){
            /*There is an element with the same id as the item we are processing*/
            if(l_El.tagName == 'INPUT'){
              /*The element is an input item just set the value*/
              l_El.value = l_Value;
            }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
              /*If it is a span elment and has the class grabber
              **Then set the innerHTML of the parent to the value
              **and the id of the parent to the id
              l_El.parentNode.innerHTML = l_Value;
              l_El.parentNode.id = l_ID;
            }else{
              /*Else set the value as innerHTML*/
              l_El.innerHTML = l_Value;
      get = null;
    Now where it went wrong in your initial post
    The XML that was returned by your XML process would be something like
    <body>
      <desc>this xml genericly sets multiple items</desc>
      <item id="f02_1">CSS Mastery</item>
      <item id="f03_1">22</item>
      <item id="f04_1">Andy Budd</item>
      <item id="f05_1">1</item>
    </body>
    When you don't use apex_item to create your tabular form a item in the table will look like
    <input id="f02_0001" type="text" value="CSS Mastery" maxlength="2000" size="16" name="f05" autocomplete="off">
    Notice the id's f02_1 and f02_0001 don't match.
    So to make it work the XML would have to look like
    <body>
      <desc>this xml genericly sets multiple items</desc>
      <item id="f02_0001">CSS Mastery</item>
      <item id="f03_0001">22</item>
      <item id="f04_0001">Andy Budd</item>
      <item id="f05_0001">1</item>
    </body>
    To do that simply use lpad in the ondemand process like
    HTP.prn ('<item id="f02_' || lpad(:t_rownum,4,'0') || '">' || v_subject || '</item>');
    HTP.prn ('<item id="f03_' || lpad(:t_rownum,4,'0') || '">' || v_price || '</item>');
    HTP.prn ('<item id="f04_' || lpad(:t_rownum,4,'0') || '">' || v_author || '</item>');
    HTP.prn ('<item id="f05_' || lpad(:t_rownum,4,'0') || '">' || v_qty || '</item>');
    Keep in mind that the above is based on your original post and #ROWNUM# not being lpadded with zero's.
    Nicolette

  • How to use a select list value in a PL/SQL function body returning SQLquery

    Hi Friends,
    I have a select list P6_TEST with values 'nav' anf 'jyo'. I am trying to create a report using "SQL Query (PL/SQL
    function body returning SQL query)". In my report query can i check if P6_TEST='nav' and do something like the
    code shown below.How can i do that.
    DECLARE
    v_sql VARCHAR2(3000);
    BEGIN
    IF :P6_TEST = 'nav' THEN
    v_sql :=
    'SELECT
    * from department';
    ........................Thanks,
    Nav

    Nav:
    What you have should work. Give it a go. Post back if you run into issues.
    Varad

  • How to use the same column value in the casecadeing parameter in ssrs report?

    Hi frnz,
    I have a table site contains one filed SiteCode
    Now i have fields like below using the below quries 
    SThe above are the two results sets coming from the single table ,now i will use these two results /Query in my ssrs Casecade report
    1.First result set/Query will use for the first dataset and use these values in the paramet1 selection as PrimaryCodes
    2.Second result set/Query will use for the second Dataset and use these values in the parameter2 as SecondayCodes
    3.Using these two datsets and create a Casecadeing paramet in ssrs report.
    4.so using this information how can i create the Casecade report ,I have tried different ways but i didnt get the soluction
    I have done the follw but ididnt get the o/p.
    I have created two parameter and mapped to the results but while paramter selection i will able to see only the first paramet(PrimaryCodes) ,and i will not see the second paramter(SecondaryCodes) it could not show me the second paramter values in the drop
    down list.
    Note:Here i will use the Single Table to get the all the sitecodes 
    Can some one please help me out for this report.
    Thanks.

    Hi,
    Try below links for your reference:
    http://blogs.msdn.com/b/sqlforum/archive/2011/05/26/ssrs-cascading-parameter-with-optional-select-all-in-sql-reporting-services-report.aspx
    http://msdn.microsoft.com/en-us/library/dd255197.aspx
    http://blogs.msdn.com/b/psssql/archive/2010/01/29/how-to-have-a-select-all-multi-value-cascading-parameter.aspx
    sathya - www.allaboutmssql.com ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **.

  • How to use "&Total physical pages" in the format trigger?

    Hi all:
    How should I to use the system variable "&Physical page number" and "&Total physical pages" in the format
    trigger?
    I can not use these 2 variables in the format trigger directly or i will reveive an error message.
    Thank You!

    It may help you to know how I add JARs
    1. I open my Project (myProject)
    2. I Mount the JAR to the FileSystem (like mypackages.jar = which includes com.mus.de.myClass.java)
    3. I Mount the File to the FileSystem (like c:\..myfiles..\myProject)
    3.1 I add the File to my Project
    4. I select File | New -> Classes | Main
    4.1 I typed "import com.mus.de.myClass.java" to refer to this package.
    4.2 I called some of the public methods
    thats it
    Andreas

  • How to use decode on the value part ?

    i have a query
    select
         col1, col2, col3
    from
         tab1, tab2
    where
         cond1= 'parameter1'     
    I need to modify this query to use a decode function instead of this parameter1.
    something like
    select
         col1, col2, col3
    from
         tab1, tab2
    where
         cond1= decode(parameter1, 'x','val1','val2')
    How can i use such a decode function on the value part ?
    IF i try this, it gives me no data found error....
    The following is also not working..IS there a way to do such cases ?
    select
         col1, col2, col3
    from
         tab1, tab2
    where
         cond1= ( select decode(parameter1, 'x','val1','val2') from dual )

    Of course it works...
    test@ORA10G>
    test@ORA10G> drop table table1;
    Table dropped.
    test@ORA10G> create table table1 (
      2    name        varchar2(50),
      3    condition1  varchar2(2),
      4    condition2  varchar2(10)
      5  );
    Table created.
    test@ORA10G> insert into table1 (name,condition1,condition2)
      2  values ('Hi there!!','xx','VAL1');
    1 row created.
    test@ORA10G> commit;
    Commit complete.
    test@ORA10G>
    test@ORA10G> select * from table1;
    NAME                           CO CONDITION2
    Hi there!!                     xx VAL1
    1 row selected.
    test@ORA10G>
    test@ORA10G> declare
      2    CodeL varchar2(3) := 'AB';
      3    CodeName varchar2(50) := '';
      4  begin
      5    select decode(CodeL,'AB','VAL1', CodeL)
      6    into CodeName
      7    from dual;
      8    dbms_output.put_line('CodeName: '||CodeName);
      9    select Name
    10    into CodeName
    11    from table1
    12    where condition1='xx'
    13    and condition2 in ( select decode(CodeL,'AB','VAL1', CodeL) from dual );
    14    dbms_output.put_line('CodeName: '||CodeName);
    15  end;
    16  /
    CodeName: VAL1
    CodeName: Hi there!!
    PL/SQL procedure successfully completed.
    test@ORA10G>pratz

  • How do you use AVERAGE based on values from an IF formula?

    This is probably a very simple thing to do, but I haven't managed to find a solution yet. Someone please help!
    I have a spreadsheet to calculate grades for my students.
    I enter their raw scores, which is then calculated into a percentage (which I then adjust, depending on the raw average).
    I then use an IF formula to award a grade between 1 and 10 based on that adjusted percentage.
    1AB
    ASSESSMENT TASK
    Speech 1
    Speech 2
    Speech 3
    TOTAL
    FINAL GRADE
    Term 1
    MAX GRADE
    10
    10
    10
    30
    ADJ. %
    Student A
    5
    7
    7
    19
    63%
    67%
    7
    Student B
    9
    7
    7
    23
    77%
    81%
    8
    Student C
    9
    7
    9
    25
    83%
    88%
    9
    Student D
    4
    5
    5
    14
    47%
    49%
    5
    Student E
    6
    9
    6
    21
    70%
    74%
    7
    Student F
    7
    5
    5
    17
    57%
    60%
    6
    CLASS AVERAGE
    6.7
    6.7
    6.5
    19.8
    66.1%
    69.8%
    I want an average here!
    66.7%
    66.7%
    65.0%
    I would like to know the average of the grades awarded, but the AVERAGE formula does not work (I'm guessing because the numbers are as a result of a formula, not actual data typed in by me).
    Can anyone help please!?

    Thanks for your response!
    I have simplified the sheet so it contains no split or merged cells, yet still I get the exclamation mark where I want the average. (The exclamation mark says 'Numbers can't be divided by zero'.)
    Exam
    Skit
    Exam
    Class Participation
    1
    2
    TOTAL
    MAX. MARK
    55
    30
    100
    15
    200
    ADJ. %
    MARK
    Student A
    37
    20
    84
    15
    156
    78%
    72%
    7
    Student B
    39
    28
    91
    15
    173
    87%
    80%
    8
    Student C
    39
    28
    86
    10
    163
    82%
    76%
    8
    Student D
    34
    26
    92
    15
    167
    84%
    78%
    8
    Student E
    38
    26
    74
    10
    148
    74%
    69%
    7
    CLASS AVERAGE
    37.4
    25.6
    85.4
    13.0
    161.4
    80.7%
    75.0%
    I guess the basic question is: can you actually use AVERAGE on data that is output by an IF formula?

  • How to use different default parameter value for different report subscriptions

    In ssrs is it possible to define different default parameter values for different subscriptions? In the following example I have a report which has two subscriptions with different start date and end date values:
    Report name – Testsubscription.rdl
    Subscription-1
    Input parameter (default values):
    start_date = first day of current Month
    end_date = till date
    Subscription-2
    Input parameter (default values):
    start_date = first day of current Quarter
    end_date = till date
    I know an alternative way of doing this would be to copy the rdl file with a different name but I am curious whether this can be done within a single report definition file. I am using SQL Server 2008 R2 Standard Edition.
    Thanks!
    spp

    Hi sppdba,
    As per my understanding, there is a report with two parameter: start_date and end_date, you want to configure subscription for the report, and set different default values for start date and end date. And you want to know if it is possible to achieve you
    goal by using a single report definition file.
    Since you are using SQL Server 2008 R2 Standard Edition, we need to achieve your goal by configuring two subscriptions for the report. For detail information, please refer to the following steps:
      1. In design surface, right click start_date and open Parameter Properties dialog box.
      2. In General pane, type Name and Prompt, set Data Type to Date/Time.
      3. Click Available Values in left pane, select Specify Values.
      4. Click Add button, in Label text box, type “First day of Current Month”, click (fx) button in Value section, then type the expression like below:
    =DateSerial(Year(Now()), Month(Now()), 1)
      5. Click Add button, in Label text box, type “First day of Current Quarter”, click (fx) button in Value section, then type the expression like below, then click OK.
    =DateSerial(Year(Now()), (3*DatePart("q",Now()))-2, 1)
      6. Right click end_date and open Parameter Properties dialog box.
      7. In Available Values pane, select Specify Values.
      8. Click Add button, in Label text box, type “Today”, click (fx) button in Value section, then type the expression =Today(), then click OK.
    Now that the parameters are created, we need to configure subscription for the report. For detail information, please follow these steps:
      1. Open Report Manager, and locate the report for which you want to create a new subscription.
      2. Hover over the report, and click the drop-down arrow.
      3. In the drop-down menu, click Manage. This opens the General properties page for the report.
      4. Select the Subscriptions tab, and then click New Subscription.
      5. Select the delivery extension and data source for the subscription.
      6. Select a method of delivery, then choose report delivery options.
      7. Specify conditions that cause the subscription to process and delivery to occur.
      8. Set start_date to First day of Current Month, end_date to Today, then click OK.
      9. Create a new subscription as step4 to 7, set start_date to First day of Current Quarter, end_date to Today, then click OK.
    The following screenshots are for your reference:
    For detail information about Creating Standard Subscriptions, please refer to the following document:
    http://msdn.microsoft.com/en-us/data/ms156307(v=sql.105)
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    If you have any feedback on our support, please click
    here.

Maybe you are looking for