Predict / fill in values for missing values

Hi,
We have some readings taken for each patient for every month for the complete year. If there are any points missing for a patient for certain month, is there any function or something that Oracle provides to fill in for this point. We know that SAS has such function. Could you please let me know if Oracle has such facility? Thanks,
Lakshmi

Hi Lakshmi,
Oracle offers a number of linear regression methods. (I think as of version 9i)
Maybe you should have a look at them :
REGR_SLOPE     returns the slope of the line. The return value is a number and can be null. After the elimination of null (expr1, expr2) pairs, it makes the following computation:
COVAR_POP(expr1, expr2) / VAR_POP(expr2)
REGR_INTERCEPT     returns the y-intercept of the regression line. The return value is a number and can be null. After the elimination of null (expr1, expr2) pairs, it makes the following computation:
AVG(expr1) - REGR_SLOPE(expr1, expr2) * AVG(expr2)
REGR_COUNT     returns an integer that is the number of non-null number pairs used to fit the regression line.
REGR_R2     returns the coefficient of determination (also called "R-squared" or "goodness of fit") for the regression. The return value is a number and can be null.
REGR_AVGX     evaluates the average of the independent variable (expr2) of the regression line. It makes the following computation after the elimination of null (expr1, expr2) pairs:
AVG(expr2)
REGR_AVGY     evaluates the average of the dependent variable (expr1) of the regression line. It makes the following computation after the elimination of null (expr1, expr2) pairs:
AVG(expr1)
REGR_SXX     makes the following computation after the elimination of null (expr1, expr2) pairs:
REGR_COUNT(expr1, expr2) * VAR_POP(expr2)
REGR_SYY     makes the following computation after the elimination of null (expr1, expr2) pairs:
REGR_COUNT(expr1, expr2) * VAR_POP(expr1)
REGR_SXY     makes the following computation after the elimination of null (expr1, expr2) pairs:
REGR_COUNT(expr1, expr2) * COVAR_POP(expr1, expr2)
REGR_SXY, REGR_SXX, REGR_SYY are auxiliary functions that are used to compute various diagnostic statistics.
Best Regards,
Kris

Similar Messages

  • If Condition for missing value or zero

    Hi There,
    I have formula like this
    IF (("ActualTax" ==0 ) and @ISMBR("Budget") )
    "BudgetTax" = "Revenue" * 0.37;
    But ActualTax in case could also be blank or missing value, how do I say it in the script
    I try IF (("ActualTax"=='#MI') and ..., it gave me error
    Thanks

    Mehmet,
    Thanks. == missing works. On my elseif, I also want to say ActualTax < 0, do something else, but it seems the condition not getting picked up. Or how do I say ActualTax has value, then BudgetTax = 0 or no value
    IF (("ActualTax" ==0 ) and @ISMBR("Budget") )
    "BudgetTax" = "Revenue" * 0.37;
    ELSEIF("ActualTax" <0)
    Thanks
    Edited by: Donny on Feb 6, 2012 9:34 AM

  • CR2008 and SAP BW - Technical Values for variable values not displayable ?

    Hello Experts,
    we have the following constellation / problem:
    - SAP Query BW 7.0 with variables
    - a report built upon this query with Crystal Reports 2008
    - now if we execute the report and try to fill in the parameters (= SAP BW variables), only the (SAP) description of each value is displayed
    Since it is common for the business users to communicate with the key instead of the description (e.g. Project 50010001 instead of Project 'something etc something'), it is necessary for us to give them the opportunity from a list that contains the key (maybe as well as the description) instead of only the description. Is there a possibility in SAP BW or Crystal Reports 2008 to make that possible ?
    I tried to do it in the infoobject, in the query, in the 'options'-section of Crystal Reports and in the properties of the parameter field itself, but to no avail.
    Many thanks for your help in advance !
    Frank

    Hello Experts,
    I facing a problem.
    I have a crystal report based on a BW Query. It has one parameter called Country.
    Eg:
    Until now, in BW query country variable has the following values.
    USA
    JAPAN
    GERMANY
    Now, from this fiscal year we have the following values for country variable
    USA
    JAPAN
    INDIA
    GERMANY
    UK
    I am trying to edit the list of values for the country variable in crystal reports. It is not getting reflected in SAP BW. I also tried refreshing it several times.
    Can any one Please help.!!
    Regards
    NMU

  • The value for The value for the useBean invalid?

    I get following error when I try to test application in iexplorer.
    org.apache.jasper.JasperException: /guestBookLogin.jsp(12,0) The value for the useBean class attribute com.deitel.jhtp6.jsp.beans.GuestBean is invalid.
    I got this code from a case study and I was testing it. I get
    org.apache.jasper.JasperException: /guestBookLogin.jsp(12,0) The value for the useBean class attribute com.deitel.jhtp6.jsp.beans.GuestBean is invalid.
    error
    I believe this is becaus of version difference but here is my code
    guestBookLogin.jsp
    <!- <?xml version = "1.0"?> -->
    <!-  DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" -->
    <!-- Fig. 27.22: guestBookLogin.jsp -->
    <%-- page settings --%>
    <%@ page errorPage = "guestBookErrorPage.jsp" %>
    <%-- beans used in this JSP --%>
    <jsp:useBean id = "guest" scope = "page"
       class = "com.deitel.jhtp6.jsp.beans.GuestBean" />
    <jsp:useBean id = "guestData" scope = "request"
       class = "com.deitel.jhtp6.jsp.beans.GuestDataBean" />
    <html xmlns = "http://www.w3.org/1999/xhtml">
    <head>
       <title>Guest Book Login</title>
       <style type = "text/css">
          body
             font-family: tahoma, helvetica, arial, sans-serif;
          table, tr, td
             font-size: .9em;
             border: 3px groove;
             padding: 5px;
             background-color: #dddddd;
          }`
       </style>
    </head>
    <body>
       <jsp:setProperty name = "guest" property = "*" />
       <% // start scriptlet
          if ( guest.getFirstName() == null ||
               guest.getLastName() == null ||
               guest.getEmail() == null )
       %> <%-- end scriptlet to insert fixed template data --%>
             <form method = "post" action = "guestBookLogin.jsp">
                <p>Enter your first name, last name and email
                   address to register in our guest book.</p>
                <table>
                   <tr>
                      <td>First name</td>
                      <td>
                         <input type = "text" name = "firstName" />
                      </td>
                   </tr>
                   <tr>
                      <td>Last name</td>
                      <td>
                         <input type = "text" name = "lastName" />
                      </td>
                   </tr>
                   <tr>
                      <td>Email</td>
                      <td>
                         <input type = "text" name = "email" />
                      </td>
                   </tr>
                   <tr>
                      <td colspan = "2">
                         <input type = "submit" value = "Submit" />
                      </td>
                   </tr>
                </table>
             </form>
       <% // continue scriptlet
          }  // end if
          else
             guestData.addGuest( guest );
       %> <%-- end scriptlet to insert jsp:forward action --%>
             <%-- forward to display guest book contents --%>
             <jsp:forward page = "guestBookView.jsp" />
       <% // continue scriptlet
          }  // end else
       %> <%-- end scriptlet --%>
    </body>
    </html>GuestBean.java
    * @(#)GuestBean.java
    * @author:
    * @Description: JavaBean to store data for a guest in the guest book.
    * @version 1.00 2008/7/18
    // JavaBean to store data for a guest in the guest book.
    package com.deitel.jhtp6.jsp.beans;
    public class GuestBean
       private String firstName;
       private String lastName;
       private String email;
       //Constructors
       public GuestBean(){
            public GuestBean(String firstname, String lastname, String email){
                 this.firstName=firstname;
                 this.lastName=lastName;
                 this.email=email;
       // set the guest's first name
       public void setFirstName( String name )
          firstName = name; 
       } // end method setFirstName
       // get the guest's first name
       public String getFirstName()
          return firstName; 
       } // end method getFirstName
       // set the guest's last name
       public void setLastName( String name )
          lastName = name; 
       } // end method setLastName
       // get the guest's last name
       public String getLastName()
          return lastName; 
       } // end method getLastName
       // set the guest's email address
       public void setEmail( String address )
          email = address;
       } // end method setEmail
       // get the guest's email address
       public String getEmail()
          return email; 
       } // end method getEmail
    } // end class GuestBeanGuestBeanData.java
    * @(#)GuestDataBean.java
    * @author
    * @version 1.00 2008/7/18
    // Fig. 27.21: GuestDataBean.java
    // Class GuestDataBean makes a database connection and supports
    // inserting and retrieving data from the database.
    package com.deitel.jhtp6.jsp.beans;
    import java.sql.SQLException;
    import javax.sql.rowset.CachedRowSet;
    import java.util.ArrayList;
    import com.sun.rowset.CachedRowSetImpl; // CachedRowSet implementation
    public class GuestDataBean
       private CachedRowSet rowSet;
       // construct TitlesBean object
       public GuestDataBean() throws Exception
          // load the MySQL driver
          Class.forName( "com.mysql.jdbc.Driver" );
          // specify properties of CachedRowSet
          rowSet = new CachedRowSetImpl(); 
          rowSet.setUrl( "jdbc:mysql://localhost/VirsarMedia" );
          rowSet.setUsername( "root" );
          rowSet.setPassword( "" );
           // obtain list of titles
          rowSet.setCommand(
             "SELECT firstName, lastName, email FROM guest" );
          rowSet.execute();
       } // end GuestDataBean constructor
       // return an ArrayList of GuestBeans
       public ArrayList< GuestBean > getGuestList() throws SQLException
          ArrayList< GuestBean > guestList = new ArrayList< GuestBean >();
          rowSet.beforeFirst(); // move cursor before the first row
          // get row data
          while ( rowSet.next() )
             GuestBean guest = new GuestBean();
             guest.setFirstName( rowSet.getString( 1 ) );
             guest.setLastName( rowSet.getString( 2 ) );
             guest.setEmail( rowSet.getString( 3 ) );
             guestList.add( guest );
          } // end while
          return guestList;
       } // end method getGuestList
       // insert a guest in guestbook database
       public void addGuest( GuestBean guest ) throws SQLException
          rowSet.moveToInsertRow(); // move cursor to the insert row
          // update the three columns of the insert row
          rowSet.updateString( 1, guest.getFirstName() );
          rowSet.updateString( 2, guest.getLastName() );
          rowSet.updateString( 3, guest.getEmail() );
          rowSet.insertRow(); // insert row to rowSet
          rowSet.moveToCurrentRow(); // move cursor to the current row
          rowSet.acceptChanges(); // propagate changes to database
       } // end method addGuest
    } // end class GuestDataBeanguestBookErrorPage.jsp
    <!-- <?xml version = "1.0"?> -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <!-- Fig. 27.24: guestBookErrorPage.jsp -->
    <%-- page settings --%>
    <%@ page isErrorPage = "true" %>
    <%@ page import = "java.util.*" %>
    <%@ page import = "java.sql.*" %>
    <html xmlns = "http://www.w3.org/1999/xhtml">
       <head>
          <title>Error!</title>
          <style type = "text/css">
             .bigRed
                font-size: 2em;
                color: red;
                font-weight: bold;
          </style>
       </head>
       <body>
          <p class = "bigRed">
          <% // scriptlet to determine exception type
             // and output beginning of error message
             if ( exception instanceof SQLException )
          %>
                A SQLException
          <%
             } // end if
               else if ( exception instanceof ClassNotFoundException )
          %>
                A ClassNotFoundException
          <%
             } // end else if
             else
          %>
                An exception
          <%
             } // end else
          %>
          <%-- end scriptlet to insert fixed template data --%>
             <%-- continue error message output --%>
             occurred while interacting with the guestbook database.
          </p>
          <p class = "bigRed">
             The error message was:<br />
             <%= exception.getMessage() %>
          </p>
          <p class = "bigRed">Please try again later</p>
       </body>
    </html>
    guestBookView.jsp
    <!-- <?xml version = "1.0"?> -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <!-- Fig. 27.23: guestBookView.jsp -->
    <%-- page settings --%>
    <%@ page errorPage = "guestBookErrorPage.jsp" %>
    <%@ page import = "java.util.*" %>
    <%@ page import = "com.deitel.jhtp6.jsp.beans.*" %>
    <%-- GuestDataBean to obtain guest list --%>
    <jsp:useBean id = "guestData" scope = "request"
       class = "com.deitel.jhtp6.jsp.beans.GuestDataBean" />
    <html xmlns = "http://www.w3.org/1999/xhtml">
       <head>
          <title>Guest List</title>
          <style type = "text/css">
             body
                font-family: tahoma, helvetica, arial, sans-serif;
             table, tr, td, th
                text-align: center;
                font-size: .9em;
                border: 3px groove;
                padding: 5px;
                background-color: #dddddd;
          </style>
       </head>
       <body>
          <p style = "font-size: 2em;">Guest List</p>
          <table>
             <thead>
                <tr>
                   <th style = "width: 100px;">Last name</th>
                   <th style = "width: 100px;">First name</th>
                   <th style = "width: 200px;">Email</th>
                </tr>
             </thead>
             <tbody>
             <% // start scriptlet
                List guestList = guestData.getGuestList();
                Iterator guestListIterator = guestList.iterator();
                GuestBean guest;
                while ( guestListIterator.hasNext() )
                   guest = ( GuestBean ) guestListIterator.next();
             %> <%-- end scriptlet; insert fixed template data --%>
                   <tr>
                      <td><%= guest.getLastName() %></td>
                      <td><%= guest.getFirstName() %></td>
                      <td>
                         <a href = "mailto:<%= guest.getEmail() %>">
                            <%= guest.getEmail() %></a>
                      </td>
                   </tr>
             <% // continue scriptlet
                } // end while
             %> <%-- end scriptlet --%>
             </tbody>
          </table>
       </body>
    </html>Edited by: Areeba on Jul 19, 2008 10:34 PM

    Thanks I got it working. The problem was my mistake (ofcourse) I had my class in this folder WEB_INF/com/..... I did had classes folder under WE-INF . I'll get rest working soon. Thanks for the help.
    Edited by: Areeba on Jul 21, 2008 5:02 PM
    =====================
    I get this eror
    javax.servlet.ServletException: Can't call commit when autocommit=true
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
         org.apache.jsp.guestBookLogin_jsp._jspService(org.apache.jsp.guestBookLogin_jsp:172)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    javax.sql.rowset.spi.SyncProviderException: Can't call commit when autocommit=true
         com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:886)
         com.deitel.jhtp6.jsp.beans.GuestDataBean.addGuest(GuestDataBean.java:75)
         org.apache.jsp.guestBookLogin_jsp._jspService(org.apache.jsp.guestBookLogin_jsp:145)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)on here
      rowSet.acceptChanges(); // propagate changes to databaseit updated the database but with error.
    Edited by: Areeba on Jul 21, 2008 5:23 PM
    Edited by: Areeba on Jul 21, 2008 5:57 PM

  • Getting wrong values  for decimal value in Bex report

    Hi,
         I am getting some problem in Bexreport decimal values.
       In ODS i am able to look the values for this key figure
      (Total PO Release Val)= 140.692,00,the same value in Bex report looks like this $ 140,692.00.
         Here one calculation is going with these above values
       % Used = 'Total PO Release Val' / 'Target Value' * 100
        as per ODS value calculation  it is correct = 140.692/1000 * 100 =14.692
       as per Bex  it is coming like this = 140,692.00/1000 *100 = 142.692.
        in Bex report Percentage valus is not considering value is taking as 140,692.00 rather than 140.692.I mean to say decemal values are ignoring while calculation in Bexreport.can you any please advice me how to comeout of this problem.Appreciate your help.
    Regards
    Ramesh

    <i> "(Total PO Release Val)= 140.692,00,the same value in Bex report looks like this $ 140,692.00."
    </i>
    How do you check the ODS value? The amount will only have two decimal places after it, so you can't have a value like 140.692,00. It seems to be an issue of user's decimal notation (where decimal is represented by comma, and thousand seperator by '.'). Go to user profile, change this setting (in default tab) to correct one (ie decimal being represented by '.') and login again and check it. The value that you see in ODS is 'one hundred forty thousand six hundred ninety two, the same that you get in Bex, only the representation is different).

  • Multiple single value for default value?!?

    Hi guys,
    by making a characteristic value variable how can I add more than one value (not interval) for default value? I cannot even add more value if the char. variable represents multiple single values...
    Thx.

    Hi,
    For that you can make use of customer exit variable.
    else refer this link:[Variable with Multiple Default Values;
    Regards,
    Rajkandula

  • Sql to fetch values for missing records.

    Hi All,
    I'm working on oracle 10gR2.I'm having trouble writing a query for the below and I know you genious guys can help me.
    I have the below table data.
    The data is read as....for Name R-VA013SC between from_m 0 and to_m 0.5 the average daily value is 30 and volume is 34 for the year 1929.
    similarly next record for Name R-VA013SC between from_m 0 and to_m 0.5 the average daily value is 40 and volume is 43 for the year 2001.
    "NAME" | "FROM_M"|"TO_M"|"DATA_DATE"|"ADT""VOLUME"
    "R-VA013SC"     | 0     |0.05     | *01-JAN-29......|*     30 |     34     
    "R-VA013SC"     | 0     |0.05     | *12-SEP-01..*....| 40 |     43     
    "R-VA013SC"     | 0     |0.05     | *14-JAN-08.......|*     20 |     15     
    if you notice above, there are data missing for years from 1930 to 2000, the daily average and volume is assumed to be the previously available year, for example for the year 2000, we need to have a record with the data for 1929 with the current date like
    "R-VA013SC"     | 0     |0.05     | *01-JAN-00.....|*     30 |     34     
    for the year 2005 , the data has to copied from 2001 like .
    "R-VA013SC"     | 0     |0.05     | *12-SEP-05*......| 40 |     43
    for the year 2009, the value has to be fetched from the previously available year ie 2008 like
    "R-VA013SC"     | 0     |0.05     | *14-JAN-09*.......|     20 |     15.
    I aslo need to write a query to find the average values between 2 years,
    like if someone asks for the average volume adt ADT between 2000 and 2005, I need to find the average of the same
    like ... add the averages for 2000-2005/no of years requested(5).
    Appreciate all your help!
    Thanks in advance
    H

    Hi,
    user32322435 wrote:
    Thanks again..
    Here is the table data
    ID     NAME     FROM_M     TO_M     ADT     VOLUME     DATA_DATE
    2055801     SC-723N      0     0.05     30     34     01/01/1929
    2055801     SC-723N      0     0.05     40     43     09/12/2001
    2055801     SC-723N      0     0.05     20     15     01/14/2008I'm considering the following
    start date ='1999-07-01'
    end date ='2003-07-01'
    end_date-start_date = 1461
    So,
    days considered in 1999 is 184 *adt for 1999 is 30 = 5520
    days considered in 2000 is *366(leap year)* *adt for 2000 is 30 = 10980
    days considered in 2001 is 365 *adt for 2001 is 40 = 14600
    days considered in 2002 is 365 *adt for 2001is 40 = 14600
    days considered in 2003 is 184 *adt for 2003 is 40= 7360January 1 through July 1, 2010 is only 182 days, isn't it? That would make the total for 2003 = 7280 (net loss of 80).
    >
    5520+10980+14600+14600+7360 = 53060/no of days taken into account (1461)July 1, 1999 through July 1, 2003 inclusive is 1462 days, right? 4 * 365 = 1460, plus one February 29th, plus an extra July 1st.
    Expected ADT 53060/1461 =*36.31* With the corrections mentioned above, that's 52980 / 1462 = 36.23 (rounded).
    ......very sorry about the 38.01 . I missed something earlier.
    (select to_date('2003-07-01','YYYY-MM-DD') - to_date('1999-07-01','YYYY-MM-DD') from dual;) = 1461That's the number of days between the two. You have to add 1 if both endpoints are to be included.
    1999-07-01 through 1999-07-01 is 1 day, but the difference is 0.
    select to_date('1999-12-31','YYYY-MM-DD') - to_date('1999-07-01','YYYY-MM-DD') +1 from dual; = 184Now I understand!
    Until this message I had no idea that you wanted data_date rounded down to the beginning of the year, no matter how late in the year it actually is.
    In that case, replace data_date in the sub-query with TRUNC (data_date, 'YEAR'), and the previous query will do what you requested:
    WITH   params                      AS
         SELECT     DATE '1999-07-01'     AS begin_date
         ,     DATE '2003-07-01' + 1     AS end_date
         FROM dual
    ,     got_next_data_date     AS
         SELECT  id
    --     ,     data_date          -- REPLACED WITH FOLLOWING LINE
         ,     TRUNC (data_date, 'YEAR')     AS data_date
         ,     adt
         ,     LEAD (
                  -- data_date     -- REPLACED WITH FOLLOWING LINE
                     TRUNC (data_date, 'YEAR')
                   , 1
                   , DATE '9999-12-31'
                   ) OVER ( PARTITION BY  id
                                  ORDER BY      data_date
                           ) AS next_data_date
         FROM    table_test
    SELECT       n.id
    ,       SUM ( n.adt
               * ( LEAST ( next_data_date
                   , p.end_date
              - GREATEST ( n.data_date
                        , p.begin_date
               ) / (p.end_date - p.begin_date)      AS avg_adt
    FROM       got_next_data_date  n
    JOIN       params           p       ON     n.data_date     <= p.end_date
                            AND     p.begin_date     <= n.next_data_date
    GROUP BY  id
    ;Of course, you don't need the lines marked "REPLACED WITH FOLLOWING LINE". I left them there in case you were wondering how the query had changed.
    I also used id, instead of name, for GROUPing and PARTIONing, since that seems to reflect your posting. If one is functionally dependent on the other, then it doesn't matter which one you use.
    ... our expectation for select * from new view should be some thing like ...for those missing year the dates can be defaulted to 01_JAN. the available years are spaced just to differentiate
    ID     NAME     FROM_M     TO_M     ADT     VOLUME     DATA_DATE
    2055801     SC-723N      0     0.05     40     43     01/01/1999
    2055801     SC-723N      0     0.05     40     43     01/01/2000
    2055801     SC-723N      0     0.05     40     43     09/12/2001
    2055801     SC-723N      0     0.05     20     15     01/01/2002
    2055801     SC-723N      0     0.05     20     15     01/01/2003
    2055801     SC-723N      0     0.05     20     15     01/01/2004
    2055801     SC-723N      0     0.05     20     15     01/01/2005
    2055801     SC-723N      0     0.05     20     15     01/01/2004
    2055801     SC-723N      0     0.05     20     15     01/01/2005
    2055801     SC-723N      0     0.05     20     15     01/01/2006
    2055801     SC-723N      0     0.05     20     15     01/01/2007
    2055801     SC-723N      0     0.05     20     15     01/14/2008
    2055801     SC-723N      0     0.05     20     15     01/01/2009
    This does what you requested.
    It includes all years from the earliest data_date through either (a) the last data_date, or (b) the current year, whichever is later.
    CREATE OR REPLACE VIEW     yearly_view
    AS
    WITH     got_years_in_effect     AS
         SELECT     id, name, from_m, to_m, adt, volume, data_date
         ,     MONTHS_BETWEEN ( LEAD ( TRUNC (data_date, 'YEAR')
                                     , 1
                              , ADD_MONTHS ( TRUNC (SYSDATE, 'YEAR')
                                           , 12
                              ) OVER ( PARTITION BY  id
                                          ORDER BY          data_date
                        , TRUNC (data_date, 'YEAR')
                        ) / 12          AS years_in_effect
         FROM     table_test
    ,     cntr     AS
         SELECT     LEVEL     AS n
         FROM     (
                   SELECT  MAX (years_in_effect)     AS max_years
                   FROM     got_years_in_effect
         CONNECT BY     LEVEL <= max_years
    SELECT     y.id, y.name, y.from_m, y.to_m, y.adt, y.volume
    ,     CASE
              WHEN  c.n = 1
              THEN  y.data_date
              ELSE  ADD_MONTHS ( TRUNC (y.data_date, 'YEAR')
                               , 12 * (c.n - 1)
         END     AS data_date
    FROM     got_years_in_effect y
    JOIN     cntr              c     ON     c.n     <= y.years_in_effect
    ;

  • Set CrossTab Background for missing values

    I am using CR XI (ver 11.0.0.895) and I have several crosstabs that I would like to add formatting to alternate background color for either columns or rows to increase the readability of the crosstab.
    I have had relatively good success by inserting the following code in the background property of the summary field and either the row or column.
    if remainder(GridRowColumnValue('groupid'),3)=0 then crsilver else crnocolor
    I am having difficulties with areas of a few cross-tabs where no data exists leaving blank placeholders in the cross tab where the conditional formatting does not apply.
    I have tried the following code in the display string property of the summary field but it had no effect:
    If IsNull(CurrentFieldValue) = True then '!' else CurrentFieldValue
    Is there any way to force the placeholder to become a valid target for the conditional formatting that I have enabled?

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly

  • BAPI_PO_CHANGE taking default values for zaro value Condition update

    Hi,
    I am using std BAPI_PO_CHANGE for line item condition type value update.
    I want to update the condition value with zero, however it is picking some default value 10 $.
    I want to know from where it is picking that value.
          wa_item-po_item   = ls_po_detail-line_item_number.
                  wa_item-final_inv = c_x.
                  APPEND wa_item TO lt_item.
                  wa_itemx-po_item      = ls_po_detail-line_item_number.
                  wa_itemx-po_itemx     = c_x.
                  wa_itemx-final_inv    = c_x.
                  APPEND wa_itemx TO lt_itemx.
                wa_cond-itm_number = ls_po_detail-line_item_number.
                wa_cond-cond_type  = ls_po_detail-condition_type.
                wa_cond-cond_value = ls_po_detail-unit_price .
                wa_cond-currency   = c_curr.
                wa_cond-change_id  = c_insert.       
                APPEND wa_cond TO lt_cond.
                wa_condx-itm_number   = ls_po_detail-line_item_number.
                wa_condx-itm_numberx  = c_x.
                wa_condx-cond_type    = c_x.
                wa_condx-cond_value   = c_x.
                wa_condx-currency     = c_x.
                wa_condx-change_id    = c_x.
                APPEND wa_condx TO lt_condx.
       CALL FUNCTION 'BAPI_PO_CHANGE'
                EXPORTING
                  purchaseorder = wa_po_no-ebeln
                TABLES
                  return        = lt_return
                  poitem        = lt_item
                  poitemx       = lt_itemx
                  pocond        = lt_cond
                  pocondx       = lt_condx.

    Hi,
    Did you check what is there in  ls_po_detail-unit_price ??
    Check this links might help you.
    Re: BAPI_PO_CHANGE not updating Condition Price
    http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm
    Regards and Best wishes.

  • Web Analysis: Percent Function & Missing values

    Hi All,
    Our users have made some complaints after we upgraded to Web Analysis (from Analyzer) where they're seeing 'Evaluation Error' on columns in reports. It was an easy fix for Sum'd columns where we treated #Missings as '0', however we're having a difficulty with the Percent columns/calculations.
    The main problem is users do not want to see a great big Evaluation Error in the middle of a report. Ideally we'd have something like N/A which was small and unobtrusive.
    I dont' think we can change the options for Missing Values in the Calc Def because each option presents a different problem: Exclude means divide by nothing, treat as 0 means divide by 0, include means divide by missing. All result in an evaluation error.
    Has anyone got any suggestions? The simplest sounding solution would be to somehow change the appearance of Evaluation Error but I don't know if that is possible.

    Gotcha. Ok. Have you thought about creating a new hidden calculated ColumnB whereby you multiply the values in ColumnA by -1 and then set your formatting based on the result in ColumnB. If the value in B is positive then you know A was a negative number so you can go from there, in a round about way? I don't have time at the moment to think it all the way out but something to think about. If your formatting involves just colors you could use Traffic Lighting to set the color on ColumnA based on result in ColumnB. Traffic Lighting out of the box is limited but it's a start until you have time to build your own.
    -Karen

  • Unexpected minimum value for SHEAPTHRES_SHR

    Hi Folks - We keep getting the following message every 30 seconds on our BI QA server.
    2009-08-24-07.26.17.263989-240 E78429A607         LEVEL: Warning
    PID     : 930014               TID  : 15425       PROC : db2sysc 0
    INSTANCE: db2bq1               NODE : 000         DB   : BQ1
    APPHDL  : 0-28423              APPID: *LOCAL.DB2.090808073504
    AUTHID  : DB2BQ1
    EDUID   : 15425                EDUNAME: db2stmm (BQ1) 0
    FUNCTION: DB2 UDB, Self tuning memory manager, stmmComputeMinSHEAPTHRES, probe:836
    MESSAGE : Unexpected minimum value for SHEAPTHRES_SHR - value automatically
              corrected -  122423 -  2448 -  338887 -  9180 -  3 -  0 -  3.000000 -
               1 -  31 -  271110 -  630
    I am pretty sure this will have performance impact on the database as the database manager has to keep changing the SHEAPTHRES_SHR value every 30 seconds back to the correct value. Has any one seen this before? Turning off STMM is not an option. We do not want to hard code SHEAPTHRES_SHR value as the loads on BI are not-predictable in the environment.
    Pl advise.
    Thanks.

    The output of the SQL statement shows:
    MAX_PARTITION_MEM: Maximum allowed "instance_memory" (this will correspond with the current setting of instance_memory in bytes)
    CURRENT_PARTITION_MEM: Current total memory allocation (in bytes)
    PEAK_PARTITION_MEM: HWM total memory allocation (in bytes)
    The bug with the STMM memory calculation was first fixed with version 9.5 FP4 so you might have to upgrade your instances to FP4. In fact, if I am not mistaken, SAP withdrew FP3 due to a hiper apar which can potentially impact SAP systems.
    Also as far as the values in the output of the query and db2pd are concerned, they are not different. The output of the query is expressed in bytes whereas the output of pd is expressed in KB.
    $$ db2pd -dbptnmem
    Memory Limit:         36000000 KB (which is 36864000000 bytes)
    Current usage:        31746944 KB (which is 32508870656 bytes)
    HWM usage:            35704320 KB (which is 36561223680 bytes)
    Regards,
    Sameer

  • Cluster trees: suppressing counts for docs without value for metadata attr?

    Hi,
    Using metadata cluster trees on 11g in the SES standard UI, has anyone tried to either not show rows without the metadata value or to change the standard value "Miscellaneous" to something else? If so, could you provide some details on how you did this?
    An quick example of what I would like to accomplish. Let us say I have 100 documents in my result set, and 30 of them are without a value for "Author". If I create a cluster tree on metadata attribute Author, I would like to configure whether or not the 30 documents without author shown in the Author cluster tree. Secondly, I don't like the term "Miscellaneous", so I would like to change the value to "Missing value" or something like that if I decide to show the docs without value in the cluster tree.
    regards,
    Rune

    Hi,
    Using metadata cluster trees on 11g in the SES standard UI, has anyone tried to either not show rows without the metadata value or to change the standard value "Miscellaneous" to something else? If so, could you provide some details on how you did this?
    An quick example of what I would like to accomplish. Let us say I have 100 documents in my result set, and 30 of them are without a value for "Author". If I create a cluster tree on metadata attribute Author, I would like to configure whether or not the 30 documents without author shown in the Author cluster tree. Secondly, I don't like the term "Miscellaneous", so I would like to change the value to "Missing value" or something like that if I decide to show the docs without value in the cluster tree.
    regards,
    Rune

  • Clearing up accounts with zero / #missing values

    Hi all,
    Compliments of the season to everyone.
    I'm looking at cleaing up my cubes (created from Planning), I want to delete all the accounts that don't have any values in them for the last 5 years. Besides running a smartview extract, is there an easier way to check for accounts that contain either #Missing or Zero?
    Regards,
    Fraser

    Hi,
    For #missing values it's quite easy and efficient to use a smartview report, you only need to look at the top level of every aggregating dimension/hierarchy for each of the 5 years.
    Other possibility is to export every single data of the last 5 years into a SQL table, have another table contain the complete list of accounts, and use a SQL join to look for accounts with no data. Obviously the most precise method. Even if you have a big database, you will always have some dimensions that aggregate for sure so exporting the top level of those dimension should prevent you from obtaining billions and billions of SQL records.
    For zero values it could be a bit more tricky if you have accounts that are supposed for example amounts to be eliminated at higher levels, in that case they may equal 0 yet you need to preserve them, but that's application dependent.
    Thanks,
    JM

  • CR2008 and SAP BW - Only limited number of values for static parameter

    Hello Experts,
    we have the following constellation / problem:
    - SAP Query BW 7.0 with variables
    - a report built upon this query with Crystal Reports 2008
    - now if we execute the report and try to fill in the parameters (= SAP BW variables), not all values are displayed for selection and there seems to be no possibility to further scroll down; e.g. the months 01.1993-08.2006 are displayed, but not later than 08.2006
    This is really a problem for us since the users won´t be able to select e.g. the desired time range !
    I read already the SAP notes 1218588 and 1211902 and I 'implemented' 1211902, but still only a few values are displayed (the same as before I changed the values for BrowseTimeout and MaxNBrowseValues). Besides that, in the solutions in the SAP notes Crystal Reports 2008 is not explicitly mentioned (so I manually created the DWORD-keys).
    Many thanks for your help in advance !
    Frank

    See
    CR2008 and SAP BW - Technical Values for variable values not displayable ?
    for the answer.

  • Create subordinate values for Characteristics

    Hi ,
    I am using  BAPI to create the characteristic
        CALL FUNCTION 'BAPI_CHARACT_CREATE'
        EXPORTING
        charactdetail = gs_charactdetail
        keydate = gv_keydate
        TABLES
        charactdescr = gt_charactdescr
        charactvaluesnum = gt_charactvaluesnum
        charactvalueschar = gt_charactvalueschar
        charactvaluescurr = gt_charactvaluescurr
        charactvaluesdescr = gt_charactvaluesdescr
        charactreferences = gt_charactreferences
        charactrestrictions = gt_charactrestrictions
        return = gt_return .
    But  there is no way which i can create suboridinate values  for (charactvalueschar) . Please let me know how can i create soubordinate values for char values
    Reagrds
    Ramesh

    describe your problem.
    It does not really matter if you use standard batch input or IDOC, both will lead to the same result.
    However, object 0150 and CLFMAS are 2 different things.
    0150 is characteristics while CLFMAS is classification
    if you want classify with standard batch input then you should use 0130 instead of 0150.

Maybe you are looking for

  • OS 10.4.4 update ended my chat troubles!

    Hello all! I had a lot of trouble recently under OS 10.4.3 losing all my I-Chat contacts in dead connections. Heard the good news this moring: update to 10.4.4. One of my colleagues, where chatting was impossible with, ran it and came alive again. Se

  • InDesign CS3 (WIN): "Enable all profiles" scriptable ?

    Hi, We have to following problem: We have a large collection of IND files from different sources. When creating output, we want the image profiles to be enabled. The only way to do this, it seems, is manually when opening a document with a mismatched

  • About create BP in CRM

    hi, Experts   I call the function "BAPI_BUPA_FS_CREATE_FROM_DATA2" remote to create BP data in CRM.   the return message is "Instance BJXE001005 belonging to object type BusinessPartnerFS was created". But the BP "BJXE001005" has not been successfull

  • Urgent Help Here! Thanks.

    Hello, I'm iPhone 4s user here and I have a problem. Basically, I have uploaded new songs into my itunes, and I wanted to sync to my iPhone. However, after I sync, I found out that all the songs in my iPhone have more than 2 copies per song! So I've

  • No bill received in my mail box, after buying an iPad Air in New York

    I bought an iPad Air in Soho ,last thursday, and the bill was supposed to be sent to my mail box and nothing has been received. Could you please tell me How to do to get it? Thanks