Determine Max Value from Lower level?

Hi,
I have requirement to determine maximum value from lower levels. Please post your ideas to resolve this requirement using BEx Query designer.
Level_A1         MAX (KF1 of lower level - B1 to B2 or C11 to C1n + C21 to C2n)
    Level_B1     MAX (KF1 of lower level - C11 to C1n)
         Level_C11     KF1
         Level_C12     KF1
         Level_C13     KF1...
         Level_C1n     KF1   
    Level_B2     MAX (KF1 of lower level – C21 to C2n)
         Level_C21     KF1
         Level_C22     KF1
         Level_C23     KF1...
         Level_C2n     KF1
Thank you very much…
BW User

Did you try @ancestval http://docs.oracle.com/cd/E17236_01/epm.1112/esb_tech_ref/frameset.htm?ancestval.html
Regards
Celvin
http://www.orahyplabs.com

Similar Messages

  • Hi, I can't found on where the price different receipt from lower level come from. Please help.. Thanks a lot in advance..

    CKM3
    Category
    Quantity
    Unit
    PrelimVal
    Price Diff
    ExRt Diff
    Price
    Currency
    Beginning Inventory
    419
    KG
    18,841.59
    4,798.81
    -0.09
    56,420.79
    MYR
    Period Opening
    419
    KG
    18,841.59
    0.00
    0
    44,968.00
    MYR
    2000050719 Post closing material ledger
    0
    KG
    0.00
    4,798.81
    -0.09
    0.00
    MYR
    Receipts
    1,225.00
    KG
    55,085.80
    27,733.41
    -0.03
    67,607.49
    MYR
    Production
    1,225.00
    KG
    55,085.80
    27,733.41
    -0.03
    67,607.49
    MYR
    5000125874 Receipts from Lower Levels
    0
    KG
    0.00
    26,620.23
    -0.03
    0
    MYR
    1002200029 Order Settlement 1183964
    0
    KG
    0.00
    1,113.18
    0
    0.00
    MYR
    1002183596 GR for order 1183964/1
    1,225.00
    KG
    55,085.80
    0.00
    0.00
    44,968.00
    MYR
    Cumulative Inventory
    1,644.00
    KG
    73,927.39
    32,532.22
    -0.12
    64,756.38
    MYR
    Consumption
    225
    KG
    10,117.80
    4,452.40
    -0.02
    64,756.36
    MYR
    Not Allocated
    0
    KG
    0.00
    4,452.40
    -0.02
    0.00
    MYR
    Consumption
    225
    KG
    10,117.80
    0.00
    0
    44,968.00
    MYR
    1002191063 GD goods issue:delvy 601
    200
    KG
    8,993.60
    0.00
    0.00
    44,968.00
    MYR
    1002183646 GD goods issue:delvy 601
    25
    KG
    1,124.20
    0.00
    0.00
    44,968.00
    MYR
    Ending Inventory
    1,419.00
    KG
    63,809.59
    28,079.82
    -0.10
    64,756.38
    MYR
    5000125874 Multilevel Price Determination
    0
    KG
    0.00
    26,715.16
    -0.10
    0.00
    MYR
    4000046771 Single-Level Price Determinati
    0
    KG
    0.00
    1,364.66
    0.00
    0.00
    MYR

    Hi
    Please, address your question to SCN PP Space http://scn.sap.com/community/erp/manufacturing-pp/content
    Br, Alex

  • How to pick max value from a column of a table using cursor and iteration

    Hello Everybody
    I have a table loan_detail
    and a column in it loan_amount
    now i want to pick values from this table using cursor and then by using iteration i want to pick max value from it using that cursor
    here is my table
    LOAN_AMOUNT
    100
    200
    300
    400
    500
    5600
    700i was able to do it using simple loop concepts but when i was trying to do this by using cursor i was not able to do it .
    Regards
    Peeyush

    SQL> SELECT MAX(sal) Highest_Sal,MIN(sal) Lowest_Sal FROM emp;
    HIGHEST_SAL LOWEST_SAL
           5000        800
    SQL> set serverout on
    SQL> DECLARE
      2    TYPE tmp_tbl IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
      3    sal_tbl tmp_tbl;
      4    CURSOR emp_sal IS
      5      SELECT sal FROM emp;
      6    counter INTEGER := 1;
      7  BEGIN
      8    FOR i IN emp_sal LOOP
      9      sal_tbl(i.sal) := counter;
    10      counter := counter + 1;
    11    END LOOP;
    12    DBMS_OUTPUT.put_line('Lowest SAL:' || sal_tbl.FIRST);
    13    DBMS_OUTPUT.put_line('Highest SAL:' || sal_tbl.LAST);
    14  END;
    15  /
    Lowest SAL:800
    Highest SAL:5000
    PL/SQL procedure successfully completed.
    SQL> Even smaller
    SQL> DECLARE
      2    TYPE tmp_tbl IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
      3    sal_tbl tmp_tbl;
      4    CURSOR emp_sal IS
      5      SELECT sal FROM emp;
      6    counter INTEGER := 1;
      7  BEGIN
      8    FOR i IN emp_sal LOOP
      9      sal_tbl(i.sal) := 1;
    10    END LOOP;
    11    DBMS_OUTPUT.put_line('Lowest SAL:' || sal_tbl.FIRST);
    12    DBMS_OUTPUT.put_line('Highest SAL:' || sal_tbl.LAST);
    13  END;
    14  /
    Lowest SAL:800
    Highest SAL:5000
    PL/SQL procedure successfully completed.
    SQL> Edited by: Saubhik on Jan 5, 2011 4:41 PM

  • How to retrieve the max value from a cursor in procedure

    Hi,
    In a procedure, I defined a cursor:
    cursor c_emp is select empno, ename, salary from emp where ename like 'J%';
    but in the body part, I need to retrieve the max(salary) from the cursor.
    could you please tell me how I can get the max value from the cursor in the procedure.
    Thanks,
    Paul

    Here is one sample but you should just get the max directly. Using bulk processing should be a last resort.
    DECLARE
      CURSOR c1 IS (SELECT * FROM emp where sal is not null);
      TYPE typ_tbl IS TABLE OF c1%rowtype;
      v typ_tbl;
      max_sal number;
    BEGIN
      OPEN c1;
      max_sal := -9999999999999;
      LOOP                                                 --Loop added
        FETCH c1 BULK COLLECT INTO v LIMIT 3; -- process 3 records at a time
            -- process the records
           DBMS_OUTPUT.PUT_LINE('Processing ' || v.COUNT || ' records.');
            FOR i IN v.first..v.last LOOP
                 if v(i).sal > max_sal then
                   max_sal := v(i).sal;
                 end if;
                DBMS_OUTPUT.PUT_LINE(v(i).empno);
            END LOOP; 
        EXIT WHEN c1%NOTFOUND;
      END LOOP;
      DBMS_OUTPUT.PUT_LINE('Max salary was: ' || max_sal);
    END;
    Processing 3 records.
    7369
    7499
    7521
    Processing 3 records.
    7566
    7654
    7698
    Processing 3 records.
    7782
    7788
    7839
    Processing 3 records.
    7844
    7876
    7900
    Processing 2 records.
    7902
    7934
    Max salary was: 5000

  • Putting attribute value from java level into sessionScope variable?

    Hallo,
    is it possible to put an attribute value from java level into a sessionScope variable?
    For example when i'am in prepareSession is it possible to fill a sessionScope variable which i can use in a jspx-Site? And when how i must do it?
    Any help is appreciated.

    At the java level i make this
    private void setUserIdIntoUserDataHashtable() {
    Integer userid = getUserIdForLoggedInUser();
    Integer groupid = getGroupIdForLoggedInUser();
    Hashtable userdata = getDBTransaction().getSession().getUserData();
    if (userdata == null){
    userdata = new Hashtable();
    userdata.put(PBConstants.CURRENT_USER_ID, userid);
    userdata.put(PBConstants.CURRENT_GROUP_ID, groupid);
    And when i at the java level i can use the constants. But i don't have an interaction at this point. Thats why i don't now how to bring the values to a sessionScope variable i need later in a / some sites?

  • Min and Max values from entire table

     Hi,
     i have requirement in which i need to find the min and max values from the entire table.
    See the sample data 
    create table test
    Sal1 int,
    Sal2 int,
    Sal3 int
    insert into test values (100,700,5700)
    insert into test values (200,3300,5300)
    insert into test values (4400,1200,3500)
    insert into test values (5400,5600,3100)
    i want the output as 100 and 5700.. how can i achieve this in a single query. Please through some light on this topic..!
    Thanking you in advance
    Regards,
    Balaji Prasad B
    Balaji - BI Developer

    Below is an example with a subquery for each of the queries Mohammad posted in order to return both min and max in a single result set.
    SELECT ( SELECT MAX(Maxx) AS Maxx
    FROM test UNPIVOT
    ( Maxx FOR E IN ( Sal1, Sal2, Sal3 ) ) AS unpvt
    ) AS Maxx
    , ( SELECT MIN(Minn) Minn
    FROM test UNPIVOT
    ( Minn FOR E IN ( Sal1, Sal2, Sal3 ) ) AS unpvt
    ) AS Minxx;
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • How to find max value from a list of numbers stored in a varray?

    hi,
    Can any body help me to get the max value from a list of numbers stored in a varray?
    thanks in advance....
    regards
    LaxmiNarsimha

    Yes. Could you post what you have tried before we start helping you in this?

  • Dynamically get the Max value from table and insert max value + 1 in Target

    Hi All, I have a requirement given below, need help in building a solution for this: A mapping that will get the dynamically get the max value(Basically a number) from table , this target table is used by many other concurrent jobs and updated very frequently. My requirement is to get max value from this target table dynamically (Using dynamic look up) and then have an expression to increment by 1 and then load it to Target.I tried using SELCT max(col1) from target in dynamic look up override but this does not seem to work.Any work around here? I dont insist on using a SQL transformation here as Production DB could have 3 Million + records! Thanks in advance, -KRB

    Q/微信859034112办理科廷/ECU/MU/西澳大学毕业证成绩单及真实使馆教育部认证/永久可查Q/微信859034112办理USYD/UNSW/MQ/UTS/Monash/悉尼大学毕业证成绩单及真实教育部认证专业面向澳洲留学生提供以下服务: 一:毕业证、成绩单等全套材料,从防伪到印刷,从水印到钢印烫金,水印底纹。二:真实使馆认证(留学人员回国证明),使馆存档可通过当地使馆查询三:真实教育部认证,教育部永久存档,教育部留服网站永久可查 四:真实留信认证,留信网入库存档,永久可查  现在教育部认证办理已经不需要提供回国证明(使馆认证),如无需要,请注意办理流程!联系人:kevin  QQ: 859034112     微信:859034112如果您是以下情况,我们都能竭诚为您解决实际问题:1、在校期间,因各种原因未能顺利毕业,拿不到官方毕业证; 2、面对父母的压力,希望尽快拿到; 3、不清楚流程以及材料该如何准备; 4、回国时间很长,忘记办理; 5、回国马上就要找工作,办给用人单位看; 6、企事业单位必须要求办理的; 请联系英华教育客服kevin,专业负责为您排忧解难!资深业务!联系人:kevin    QQ: 859034112      微信:859034112 澳洲各大高校均可办理,样板齐全。 悉尼大学 TheUniversity of Sydney  新南威尔士大学TheUniversity of New South Wales  墨尔本大学 The University ofMelbourne  阿德莱德大学 Adelaide University   莫纳什大学 Monash University   昆士兰大学The University of Queensland    西澳大学 The University of WesternAustralia  澳大利亚国立大学 The Australian National University   麦考瑞大学 Macquarie University   纽卡斯尔大学 TheUniversity of Newcastle 卧龙岗大学 University of Wollongong  格里菲斯大学 Griffith University   佛林德斯大学 Flinders University  塔斯马尼亚大学 University of Tasmania  西悉尼大学Universityof Western Sydney   邦德大学Bond University    迪肯大学 Deakin University  悉尼科技大学 University of Technology ,Sydney    科汀科技大学 Curtin University of Technology  墨尔本皇家理工学院 RMIT University  昆士兰科技大学QueenslandUniversity of Technology    拉筹伯大学 La Trobe University  莫道克大学 Murdoch University  堪培拉大学 University of Canberra 旋宾科技大学 Swinburne University of Technology南澳大学Universityof South Australia  中央昆士兰大学 University of Southern Queensland   查尔斯特大学  Charles SturtUniversity  詹姆斯库克大学 James Cook University       圣母大学 Notre Dame  新英格兰大学 The University of NewEngland     南昆士兰大学  Universityof Southern Queensland  澳洲天主教大学 Australia CatholicUniversity巴里迪大学Universityof Ballarat  埃迪斯科文大学 Edith Cowan University  南十字星大学 Southern Cross University  阳光海岸大学 University of Sunshine Coast  维多利亚大学VictoriaUniversity   北领地大学 NorthernTerritory University诚招代理:本公司诚聘当地代理人员,如果你有业余时间,有兴趣就请联系我们。敬告:面对网上有些不良个人中介,真实教育部认证故意虚假报价,毕业证、成绩单却报价很高,挖坑骗留学学生做和原版差异很大的毕业证和成绩单,却不做认证,欺骗广大留学生,请多留心!办理时请电话联系,或者视频看下对方的办公环境,办理实力,选择实体公司,以防被骗!  办理悉尼大学USYD毕业证Q/微信859034112成绩单学历认证 University of Sydney 办理新南威尔士大学UNSW毕业证Q/微信859034112成绩单学历认证 University of New South Wales 办理墨尔本大学Melbourne毕业证Q/微信859034112成绩单学历认证 University of Melbourne 办理昆士兰大学Queensland毕业证Q/微信859034112成绩单学历认证 University of Queensland 办理麦考瑞大学MQU毕业证Q/微信859034112成绩单学历认证 Macquarie University 办理莫纳什大学Monash毕业证Q/微信859034112成绩单学历认证 Monash University 办理澳洲国立大学ANU毕业证Q/微信859034112成绩单学历认证 Australian National University 办理澳洲天主教大学ACU毕业证Q/微信859034112成绩单学历认证 Australian Catholic University 办理悉尼科技大学UTS毕业证Q/微信859034112成绩单学历认证 University of Technology Sydney 办理查尔斯特大学CSU毕业证Q/微信859034112成绩单学历认证 Charles Sturt University 办理格里菲斯大学Griffith毕业证Q/微信859034112成绩单学历认证 Griffith University 办理科廷大学Curtin毕业证Q/微信859034112成绩单学历认证 Curtin University 办理西悉尼大学UWS毕业证Q/微信859034112成绩单学历认证University of Western Sydney 办理澳洲纽卡斯尔大学Newcastle毕业证Q/微信859034112成绩单学历认证 University of Newcastle 办理昆士兰科技大学QUT毕业证Q/微信859034112成绩单学历认证 Queensland University of Technology 办理皇家墨尔本理工学院RMIT毕业证Q/微信859034112成绩单学历认证 RMIT University 办理卧龙岗大学Wollongong毕业证Q/微信859034112成绩单学历认证 University of Wollongong 办理迪肯大学Deakin毕业证Q/微信859034112成绩单学历认证 Deakin University 办理拉筹伯大学毕业证Q/微信859034112成绩单学历认证 La Trobe University 办理新英格兰大学UNE毕业证Q/微信859034112成绩单学历认证 University of New England办理阿德莱德大学Adelaide毕业证Q/微信859034112成绩单学历认证 University of Adelaide办理西澳大学毕业证Q/微信859034112成绩单学历认证 University of Western Australia办理堪培拉大学Canberra毕业证Q/微信859034112成绩单学历认证 University of Canberra办理塔斯马尼亚大学Tasmania毕业证Q/微信859034112成绩单学历认证 University of Tasmania办理澳洲维多利亚大学Victoria毕业证Q/微信859034112成绩单学历认证Victoria University办理中央昆士兰大学CQU毕业证Q/微信859034112成绩单学历认证 Central Queensland University办理邦德大学Bond毕业证Q/微信859034112成绩单学历认证 Bond University办理南昆士兰大学USQ毕业证Q/微信859034112成绩单学历认证 University of Southern Queensland办理南澳大学USA毕业证Q/微信859034112成绩单学历认证 University of South Australia办理斯威本科技大学SUT毕业证Q/微信859034112成绩单学历认证 Swinburne University of Technology办理詹姆斯.库克大学JCU毕业证Q/微信859034112成绩单学历认证 James Cook University办理澳洲圣母大学UND毕业证Q/微信859034112成绩单学历认证 University of Notre Dame办理南十字星大学SCU毕业证Q/微信859034112成绩单学历认证 Southern Cross University办理弗林德斯大学Flinders毕业证Q/微信859034112成绩单学历认证 Flinders University办理莫道克大学Murdoch毕业证Q/微信859034112成绩单学历认证 Murdoch University办理埃迪斯科文ECU大学毕业证Q/微信859034112成绩单学历认证 Edith Cowan University 办理查尔斯达尔文大学CDU毕业证Q/微信859034112成绩单学历认证 Charles Darwin University办理巴拉瑞特大学Ballarat毕业证Q/微信859034112成绩单学历认证 University of Ballarat办理阳光海岸大学USC毕业证Q/微信859034112成绩单学历认证University of Sunshine Coast

  • Set item value from application level item

    Hello,
    I'm using Apex 2.2.1.00.04. I've modified the Page "No Tabs" template so that I can have my own Form (which is submitted to an outside website). On this form, I create some hidden items:
    <form name="frmEPay" method="POST" action="some_website">
    <input type="hidden" id="i1" name="userId" value=&G_ID. />
    <input type="hidden" id="i11" name="timestamp" value="" />
    <input type="hidden" id="i12" name="hash" value="" />
    On this apex page, I have a javascript function which is called in the onload (basically, the ApEx webpage displays and then is redirected). Here's a snippet of that function:
    var appProc = new htmldb_Get(null, html_GetElement('pFlowId').value,'APPLICATION_PROCESS=PrepEPay',0);
    appProc.get();
    appProc = null;
    document.getElementById('i11').value = "&G_ECOM_TIMESTAMP.";
    document.getElementById('i12').value = "&G_HASH.";
    document.frm_infiNET.submit();
    As you can see, the function calls an application level On Demand process (PrepEPay). That process sets the values of the application level items G_ECOM_TIMESTAMP and G_HASH. After those App level items have their values, I want to take those values and apply them to the hidden items on my custom form. Unfortunately, it doesn't work how I have things currently. I've verified that the On Demand process is running(by viewing the Session report on the page). So my problem seems to be this: 1. Retrieving the values from the Apex application level items
    2. Setting those values to the values of my hidden items (on my custom form)
    I think the biggest reason why I'm having difficulties is because I have to do a lot of this in the template, since that is the only way to have a separate Form. Maybe my problem is that I don't understand how to reference the Apex application level item value from a different form?
    Thanks,
    Marty

    Marty,
    You are describing this as if you expect the substitution within "&G_ECOM_TIMESTAMP." and the other one to take place in some kind of lexical order, e.g., from the top to the bottom of the HTML. The replacements happen in the engine, before anything is sent to the page. Then the browser interprets language constructs such as javascript calls which in your case includes an ajax invocation of a server-side application process.
    You need to re-think the machinery here.
    Scott

  • Calculating min and max value from number array

    I have array which is having return type Number.i want to calculate min and max value of this array..try to help asap..
    Thanks
    dhanu

    hi there,
    public class MinMax {
         int arr[]= { 27, 3, 42, 18, 243, -43, 6, -8 };
         int min, max;
         public MinMax() {
    // it's very bad way to do it.
    //          min=99999;
    //          max=-99999;
    // this must be as following
                    min = max = arr[0];
              search();
              System.out.println("The minimum value is: "+min);
              System.out.println("The maximum value is: "+max);
         private void search() {
    // and here we can search from <1> index instead of <0>
              for (int j=1; j<arr.length; j++) {
                   if (arr[j]<min) {
                        min=arr[j];
                   else if (arr[j]>max) {
                        max=arr[j];
         public static void main(String args[]) {
              new MinMax();
    there is a bug in the supplied code. Your homework is
    to figure out what it is without posting another
    message for help with your homework.well, i think it's a tragedy :(

  • How to find first level WBS from Lower Level WBS

    My client is posting cost at wbs which will be at level 5 or 6 and i need to find 1st level wbs for that 5 or 6 level wbs..
    So Is there any Function module to find 1st level wbs from any lower levels...
    or any suitable code?

    Hi Sachin,
    in table PRHI you have the relationship between a WBS element and its superior level WBS element.
    For example:
    Level 1: XYZ (internal code PSPNR: 00000001)
    ..Level 2: ABC (internal code PSPNR: 00000002)
    ..Level 2: DEF (internal code PSPNR: 00000003)
    ....Level 3: PQR (internal code PSPNR: 00000004)
    ...then in table PRHI you'll have:
    PRHI-POSNR = 00000001 ... PRHI-UP = 00000000
    PRHI-POSNR = 00000002 ... PRHI-UP = 00000001
    PRHI-POSNR = 00000003 ... PRHI-UP = 00000001
    PRHI-POSNR = 00000004 ... PRHI-UP = 00000002
    ...meaning:
    WBS element XYZ is top level
    WBS element ABC depends of WBS element XYZ
    WBS element DEF depends of WBS element XYZ
    WBS element PQR depends of WBS element DEF
    Then you can iteratively (or recursively) "climb up" the structure of the project until the WBS element of level 1.
    I hope this helps. Best regards,
    Alvaro

  • Can we move account group from lower level to higher level

    Hello Experts,
    I have now 1 level hierarchy in our organisation. Now we are planning to move from 1 level to 4 level.
    Now our problem is all sold to party (c002) and ship to party ( 5103)  has same account group.
    We are going to assign sold-to-party and ship-to-party 4th level. So can we move sold-to-party account group to 3 level hierarchy account group ?
    we want to discout to customer at some level . so how we have to give discount at particular level ?
    Thanks in advance.
    Best Regards,
    Zubera

    Dear Shridar Udupi,
    Could you be kind enough to let the forum know how the issue was resolved which would help others learn.
    With best regards.
    Venkat - Hyd

  • Return max value from one column from similar values in another

    Hi folks. I've got a heap of temperature data to analyse and am looking for an easy way to extract a maximum internal temperature from a group of readings with the same external temperature. E.g. When the external temperature is 25.0 there are say 20 different internal temperature values that correspond with the different dates and times that this external temperature occurs. I'm looking for a formula I can use in a separate table with the external temperatures in a header column that will refer to the header column and extract the data from the original table. Any help appreciated! E.g. below...
    Internal (°C)
    Loc 4-Ambient
    Index
    Date
    TimeValue
    Time
    External (°C)
    22.7
    1.70
    465
    11/10/12
    0.33
    8:00:00 am
    21
    22.7
    0.90
    466
    11/10/12
    0.35
    8:30:00 am
    21.8
    24.5
    2.10
    417
    11/9/12
    0.33
    8:00:00 am
    22.4
    23.4
    1.00
    513
    11/11/12
    0.33
    8:00:00 am
    22.4
    22.9
    0.20
    467
    11/10/12
    0.38
    9:00:00 am
    22.7
    25.8
    2.90
    370
    11/8/12
    0.35
    8:30:00 am
    22.9
    25.7
    2.80
    371
    11/8/12
    0.38
    9:00:00 am
    22.9
    25.7
    2.80
    372
    11/8/12
    0.40
    9:30:00 am
    22.9
    25.6
    2.70
    373
    11/8/12
    0.42
    10:00:00 am
    22.9
    24.5
    1.60
    418
    11/9/12
    0.35
    8:30:00 am
    22.9
    25.6
    2.50
    369
    11/8/12
    0.33
    8:00:00 am
    23.1
    max temp
    21.0
    21.1
    21.2
    21.3
    21.4
    21.5

    Hi Barry,
    thanks for the response. Sorry, my example was not exactly clear. I'll take out the superfluous data and try and clarify my problem further. Based on the table below, I have sorted the data based on ascending external temperature (At these low external temperatures there are not so many data points, but when we get into the late 20s and 30s there can be hundreds of corresponding points). What I want to create is a separate table that I can graph, with the X axis showing the external temperature and the Y axis showing the maximum internal temperature that corresponds with each 0.1 degree increment of the external temperature.
    external
    internal
    16.5
    26.7
    16.5
    26.4
    17
    26.6
    17.1
    26.8
    17.2
    26.9
    17.3
    27.3
    17.3
    26.4
    17.5
    26.7
    17.6
    28.1
    17.7
    27.4
    17.8
    26.7
    17.9
    27.4
    18
    28.1
    18
    27.4
    18.1
    27
    18.1
    26.9
    18.1
    26.5
    18.1
    28
    18.2
    28.1
    18.2
    27.2
    18.3
    28.1
    18.4
    27.5
    18.4
    27.3
    So my second table would just be two columns (I had 3 in the first example because I am doing a before and after painting the roof white comparison but I'm simplifying now) with my external temperature scale in column A in 0.1 degree increments. I am looking for a formula for column B that will give me the maximum internal temperature from my range of temperatures in the first table.
    18.0
    18.1
    18.2
    18.3
    18.4
    18.5
    18.6
    18.7
    etcetera. The max for 18.1, for example, would turn out 28 based on the 4 corresponding data points in the first table.
    Ideally I would like a formula using the MAX equation because I'm hoping that I can do a similar table for getting the average internal temperature for each of the external temperature increments too, but I didn't want to overcomplicate matters.
    Cheers,
    Neewok

  • Selecting a MAX value from a table & displaying it on a form using OCI PHP

    WinXP Pro SP3- 32bit
    Apache/2.2.22 (Win32) mod_fcgid/2.3.6 PHP/5.4.0
    PHP Version 5.4.0
    Oracle epxress 11g
    problem: output on form displaying Resource id #4 instead of the number from the table.
    (maybe it's number to string conversion issue?)
    $conn = oci_connect('system', 'mypassword', 'localhost/xe');
    $query = "SELECT MAX(CustNo)+1 AS MAXNUM FROM customer";
    $stmt = OCIParse($conn, $query);
    OCIExecute($stmt);
    OCIFetch($stmt);
    echo OCIResult($stmt, "MAXNUM")." will be next number.";
    //OCIFreeStatement($stmt); //frees the resources- use a the end!
    $daNextNo = $stmt;
    echo $daNextNo;
    //$daNextNo = OCIBindByName($stmt, ":text", &$form_text, -1); //not sure how this works if it'll fix the issue
    ?>
    <form name="Addcust" action="process_cust.php" method="post">
    <input type="text" name="CustNo" value="<?php echo $daNextNo;?>" /></br>
    output of complete code:
    45 will be next number.Resource id #4
    And inside the textbox it says: 45 will be next number.Resource id #4
    how can I put the 45 into $php variable so i can use it in a textbox or on a label?
    Thank you in advance .

    THanks. i couldn;t find the PHP section.
    I figured it out
    i used nextval() to convert the object to a string.
    <?php
    $conn = oci_connect('system', '1234', 'localhost/xe');
    if (!$conn) {
    $m = oci_error();
    trigger_error('Could not connect to database: '. $m['message'], E_USER_ERROR);
    $query = "SELECT MAX(CustNo)+1 AS MAXNUM FROM customer";
    //$daNextNo = $query;
    $stmt = OCIParse($conn, $query);
    OCIExecute($stmt);
    OCIFetch($stmt);
    echo OCIResult($stmt, "MAXNUM")." will be next number.";
    //OCIFreeStatement($stmt); //frees the resources- use a the end!
    $daNextNo = strval(OCIResult($stmt, "MAXNUM")." .");
    $daNextNo = strval(OCIResult($stmt, "MAXNUM"));
    echo "danextNo: ";
    echo $daNextNo;
    ?>
    <form name="Addcust" action="process_cust.php" method="post">
                                       <div>
                                       <dl>
                                            <dt>* <?php //echo $this->lang->line('cust_fn'); ?>: </dt>
                                            <dd><input type="text" name="CustNo" value="<?php echo $daNextNo;?>" /></dd>

  • Selecting Max Value from Huge Table

    Dear Proffessionals
    I have a huge table (20,000,000+ records) with the following columns:
    [Time], [User], [Value]
    The values in [Value] column can recur for a single User at a Time e.g.
    2015-01-01, Me, X
    2015-01-01, Me, Y
    2015-01-01, Me, X
    2015-01-02, Me, Z
    2015-01-02, Me, X
    2015-01-02, Me, Z
    For each day, and for every user I want to have the maximum recurring value :
    2015-01-01, Me, X
    2015-01-02, Me, Z
    to be inserted into another table.
    PS: I want the MOST optimized way of achieving this functionality, bcause I am expecting a growth on the raw table over time, so PERFORMANCE is of great consideration.
    I would really appreciate it, if somebody can help me.
    Regards

    I can think of two techniques based on the data selecticity
    1) using row number function
    2) using cross apply operator
    USE Northwind;
    -- Solution 1
    SELECT S.SupplierID, S.CompanyName, CA.ProductID, CA.UnitPrice
    FROM dbo.Suppliers AS S
      CROSS APPLY
        (SELECT TOP (10) *
         FROM dbo.Products AS P
         WHERE P.SupplierID = S.SupplierID
         ORDER BY UnitPrice DESC, ProductID DESC) AS CA
    ORDER BY S.SupplierID, CA.UnitPrice DESC, CA.ProductID DESC;
    -- Solution 2
    WITH C AS
      SELECT S.SupplierID, S.CompanyName, P.ProductID, P.UnitPrice,
        ROW_NUMBER() OVER(
          PARTITION BY P.SupplierID
          ORDER BY P.UnitPrice DESC, P.ProductID DESC) AS RowNum
      FROM dbo.Suppliers AS S
        JOIN dbo.Products AS P
          ON P.SupplierID = S.SupplierID
    SELECT SupplierID, CompanyName, ProductID, UnitPrice
    FROM C
    WHERE RowNum <= 10
    ORDER BY SupplierID, ProductID DESC, UnitPrice DESC;
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

Maybe you are looking for

  • Single User Mode : Read Only Filesystem

    I can't edit files in single user mode as Root. When I try to edit them I get a msg saying "Read Only Filesystem". I have tried chmod with no evial. I want to change my .profile as root so cls='clear'. Any ideas? Also when I try to login to my accoun

  • Purchase requisition triggering from CRM

    Hi experts, We are struggling to create a purchase requisition in ecc from service order. Rightnow we are facing the error in which the system is tryig to create a purchase requisition but it is picking a default purchasing organisation 0001 from som

  • Group Currency - adding with local 2nd currency

    Dear All, If I can select 30 as Group Currency system automatically picks as "EUR" as a Group Company is Europe.   The first Local Currency is INR.    I want to bring the USD as the 2nd local currency.    USD added the Country Code settings in IN and

  • Create Dotted line reporting and direct reporting btwn org unit to org unit

    Hi, Currently I am working on matrix reporting structure. My requirement is to identify the dotted line reporting as well as direct reporting between org units to org units and where the relationships are storing and which tables. Can somebody please

  • Pie Chart summarizing grid data

    New to Flex.  Searched for a method to build a pie chart based on a column in the grid we've created. So Far: The grid gets created based on info passed in a form. I can get two pie charts to be created based on specific columns in the data. The pie