Display last value from a row or column?

I'm using Numbers 09 and want to display the last value entered in a column in another table.
For example in Table A I have columns set up by date with simple sums at the bottom of each column. I add new sums every day depending on the values from that day. What I'd like to do is get the last daily total and enter that value into another table called Table B. Is there a formula that will do that?
If I'm not being clear enough please let me know what additional information you need and I will be happy to provide it.
Thanks,
rkaufmann87

rkaufmann87 wrote:
Hi Barry,
Thanks for posting the example, not quite though. In your sample Table A is transferring all the totals to Table B. What I'd like is as I enter the data in the columns in Table A Table B then picks up the latest update in a single cell. For example lets say Table A's Column A is May 1 and the total is 45, let's say that sum is placed in A15. Table B automatically picks up A15 from Table A and makes a duplicate in Table B cell A1, then the next day Table A's Column B is May 2 and the total is 90 (cell B15), then Table B senses the latest total is 90 and enters that in cell A1 again. Is this possible?
Here's another go.
Table 1 has a second Header row added (row 2) Cells in this row contain the formula
=IF(A1=MAX($1:1),COLUMN(),"")
Which returns the column number of the cell in row 1 containing the latest date. (4) This number is used by Table 2 to determine the column from which to return the total in the bottom (footer) row. (see below)
A1 in Table 2 and Table 3 contain the same formula:
=MAX(Table 1 :: $1:1)
This returns the latest date from row 1 of Table 1.
A2 in Table 2 and Table 3 contain formulas that return the value in the bottom cell of the column containing the latest date in row 1.
Table 2:   =OFFSET(Table 1 :: $A$1,ROWS('May 1, 2010')-1,MAX(Table 1 :: $2:2)-1)
Table 3:   =OFFSET(Table 1 :: $A$1,ROWS('May 1, 2010')-1,COUNT(Table 1 :: $1:1)-1)
Both use the same base ($A$1) and the same row offset (ROWS('May 1, 2010')-1) to reach the bottom row of Table 1.
Table 2 uses the maximum (and only) numerical value in row 2 of Table 1 ( MAX(Table 1 :: $2:2) ), then subtracts 1 to reach the fourth column of table 1.
Table 3 uses the same means to determine the row offset, but counts the number of dates entered into row 1 of Table 1 ( COUNT(Table 1 :: $1:1) ), then subtracts 1 to reach the same cell.
I prefer the method in Table 3 because it avoids the need for the second Header row and the possibility of overwriting the formulas in that row. (Row 2 of Table 1 may be deleted without affecting Table 3.) It does require that there be no empty cells in Row 1 from Column A to the column containing the latest date.
Regards,
Barry

Similar Messages

  • How To Concatenate Column Values from Multiple Rows into a Single Column?

    How do I create a SQL query that will concatenate column values from multiple rows into a single column?
    Last First Code
    Lesand Danny 1
    Lesand Danny 2
    Lesand Danny 3
    Benedi Eric 7
    Benedi Eric 14
    Result should look like:
    Last First Codes
    Lesand Danny 1,2,3
    Benedi Eric 7,14
    Thanks,
    David Johnson

    Starting with Oracle 9i
    select last, first, substr(max(sys_connect_by_path(code,',')),2) codes
    from
    (select last, first, code, row_number() over(partition by last, first order by code) rn
    from a)
    connect by last = prior last and first = prior first and prior rn = rn -1
    start with rn = 1
    group by last, first
    LAST       FIRST      CODES                                                                                                                                                                                                  
    Lesand         Danny          1,2,3
    Benedi         Eric           7,14Regards
    Dmytro

  • Get values from selected row in a Table?

    Hello.
    I'm on VC 7.1 (the trial version downloaded from SDN).
    I'm trying to figure out a way to retrieve some values from the currently selected row in a Table element through the output connector.
    I have a web-service which returns results to the Table, and I want the user to be able to select one of the rows and then trigger another web-service call with some of the values from that row -- is this possible?
    Also, I can't find any documentation that lists what can and can't be done with each UI element, is there something like this some where? (the Modeler's guide doesn't help, and the Reference guide seems to focus on menu items and what the VC screen looks like)
    Thanks,
    Alon

    Hi Alon
    This is a very simple task.
    You just need drag the service which you want to execute, after select row, in model.
    Drag output connector from table to input connector of service. Then map the parameter.
    Regards
    Marcos

  • Hi, how can i break the value for a row and column once i have converted the image to the array?????​??

    Hi, I would like to know how can i break the value for a row and column once i have converted the image to the array. I wanted to make some modification on the element of the array at a certain position. how can i do that?
    At the moment (as per attachhment), the value of the new row and column will be inserted by the user. But now, I want to do some coding that will automatically insert the new value of the row and the column ( I will use the formula node for the programming). But the question now, I don't know how to split the row and the column. Is it the value of i in the 'for loop'? I've  tried to link the 'i' to the input of the 'replace subset array icon' , but i'm unable to do it as i got some error.
    Please help me!
    For your information, I'm using LABView 7.0.

    Hi,
    Thanks for your reply.Sorry for the confusion.
    I manage to change the array element by changing the row and column value. But, what i want is to allow the program to change the array element at a specified row and column value, where the new value is generated automatically by the program.
    Atatched is the diagram. I've detailed out the program . you may refer to the comments in the formula node. There are 2 arrays going into the loop. If a >3, then the program will switch to b, where if b =0, then the program will check on the value of the next element which is in the same row with b but in the next column. But if b =45, another set of checking will be done at a dufferent value of row and column.
    I hope that I have made the problem clear. Sorry if it is still confusing.
    Hope you can help me. Thank you!!!!
    Attachments:
    arrayrowncolumn2.JPG ‏64 KB

  • How do I read text from specific rows and columns in a tree structure?

    How do I read text from specific rows and columns in a tree structure? In a table you can specify the cell to read from but I have not been able to figure out how to do this with a tree structure.

    You need to set two properties to activate the correct cell and then you can read it's string property.
    The positioning properties are the "ActiveItemTag" and
    "ActiveColNum" properties. With them you select the tree item by it's tag and the active column. The string can then be read from the "Cell String" property.
    MTO

  • Display a value from PLSQL code to screen

    How to display a value from PLSQL code to screen without loading or refreshing the page?
    im using ajax to call the javascript to run the PLSQL code. i desire to view some value in the screen when i run the PLSQL code
    skud.

    anything that you print from the PLSQL code(using htp.p, htp.prn etc) with will available in Javascript as the server response. You can parse that string it in javascript and display it on screen or modify page items or create dynamic items/elements using those values.
    A minimal example
    Ondemand PLSQL process : TEST_PROCESS
    begin
      htp.prn('hello world');
    end;Javascript Code
    var ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=TEST_PROCESS',0);
    ajaxResult = ajaxRequest.get();
    alert(ajaxResult);Will display an alert message "hello world"
    You can construct the string in JSON/XML format in PLSQL to pass complex data structures(or multiple values) or even HTML code, then do the required processing in Javascript, for example extract out item values from it and set items, convert the JSON array to a select list item in the page or put the HTML code with a div element in the page.

  • SQL Developer - Pulling column value from previous row

    I am using Oracle SQL developer and trying to pull a value from a column from the previous row.
    Currently this is an example from the code im using.
    Select CD1.nbr_dw, CD1.SEQ_DW, CD1.CDL_NET_PAID, CD1.UNITS_ALLOW,CD1.ALLOW_AMT, CD1.UNIT_PRICE, CD1.BACKED_OUT,
    case
    When CD1.NET_PAID = 0 then 0
    ****NEW CODE*****
    Else CD1.ALLOW_AMT / CD1.UNIT_PRICE
    end as NEW_UNITS
    From Table_A CD1
    join (Select nbr_dw, DET_DW, SEQ_DW
    From Table_B
    ) CD2
    on CD1.nbr_dw = CD2.nbr_dw
    I need to add another when statement that says when CD1.BACKED_OUT = 'Y' populated the NEW_UNITS field with the previous rows value of CD1.UNIT_PRICE. Note, the CD1.SEQ_DW can be used to determine the previous row. Any ideas?

    Hi,
    Welcome to the forum!
    The analytic LAG function can return a value from the previous row:
    LAG (cd1.unit_price) OVER ( -- PARTITION BY  x          -- if needed
                                   ORDER BY          cd1.seq_dw
                     )It's unclear if you need a PARTITION BY clause or not.
    "PARTITION BY x" means that you want the value from the last row that has the same value of x as the current row.
    If you omit the PARTITION BY clause, it means you want the last row regardless of what any other columns are.
    Whenever you have a problem, it ehlps if you post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data.
    Explain how you get those results from that data.
    Always say what version of Oracle you're using.

  • Custom row-fetch and how to get column values from specific row of report

    Hi -- I have a case where a table's primary key has more than 3 columns. My report on the
    table has links that send the user to a single-row DML form, but of course the automatic
    fetch won't work because 1) I can't set more than 3 item values in the link and 2) the
    auto fetch only handles 2 PK columns.
    1)
    I have written a custom fetch (not sure it's the most elegant, see second question) that is working
    for 3 or few PK columns (it references the 1-3 item values set in the link), but when there are
    more than 3, I don't know how to get the remaining PK column values for the specific row that was
    selected in the report. How can I access that row's report column values? I'll be doing it from the
    form page, not the report page. (I think... unless you have another suggestion.)
    2)
    My custom fetch... I just worked something out on my own, having no idea how this is typically
    done. For each dependent item (database column) in the form, I have a source of PL/SQL
    function that queries the table for the column in question, using the primary key values. It works
    beautifully, though is just a touch slow on my prototype table, which has 21 columns. Is there
    a way to manually construct the fetch statement once for the whole form, and have APEX be smart
    about what items get what
    return values, so that I don't have to write PL/SQL for every item? Because my query data sources
    are sometimes in remote databases, I have to write manual fetch and dml anyway. Just would like
    to streamline the process.
    Thanks,
    Carol

    HI Andy -- Well, I'd love it if this worked, but I'm unsure how to implement it.
    It seems I can't put this process in the results page (the page w/ the link, that has multiple report rows), because the link for the row will completely bypass any after-submit processes, won't it? I've tried this in other conditions; I thought the link went directly to the linked-to page.
    And, from the test of your suggestion that I've tried, it's not working in the form that allows a single row edit. I tried putting this manually-created fetch into a before header process, and it seems to do nothing (even with a hard-coded PK value, just to test it out). In addition, I'm not sure how, from this page, the process could identify the correct PK values from the report page, unless it can know something about the row that was selected by clicking on the link. It could work if all the PK columns in my edit form could be set by the report link, but sometimes I have up to 5 pk columns.
    Maybe part of the problem is something to do with the source type I have for each of the form items. With my first manual fetch process, they were all pl/sql functions. Not sure what would be appropriate if I can somehow do this with a single (page level?) process.
    Maybe I'm making this too hard?
    Thanks,
    Carol

  • Sum of Values from previous rows in a dynamic table

    Hello,
    I have a dynamic table has multiple rows (added dynamically via a button).  One column in the table is a Quantity column.  Another is a Total column.  We do not want to keep a running total, but only wish to display a total when the rest of the cells in that row are emty and the previous row(s) has/have values in the Quantity column.  The Total is the sum on the Quatnities up to a blank row.  Below is a sample.  How do I get teh value of the Quantities in the previous rows?
    Quantity
    Total
    5
    8
    12
    25
    7
    27
    34
    22
    22
    Another option might be to put the Total in the last row with data as opposed to the row below the data.
    Any ideas?
    Regards,
    Karl

    The script is written to achive your requirement (i.e. the second approach you have mentioned)
    You can either contact me at [email protected] to get the sample form created.
    Or the following is the XML Source of the form. Copy the entire content in XML source view of your form and see the result.
    <?xml version="1.0" encoding="UTF-8"?>
    <?xfa generator="AdobeLiveCycleDesignerES_V9.0.0.0.20091029.1.612548" APIVersion="3.1.9277.0"?>
    <xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/" timeStamp="2012-02-28T14:04:54Z" uuid="2c561cdf-3377-4e84-9a89-51e740bb2fea">
    <template xmlns="http://www.xfa.org/schema/xfa-template/2.8/">
    <?formServer defaultPDFRenderFormat acrobat9.0dynamic?>
    <subform name="form1" layout="tb" locale="en_US" restoreState="auto">
    <pageSet>
    <pageArea name="Page1" id="Page1">
    <contentArea x="0.25in" y="0.25in" w="197.3mm" h="284.3mm"/>
    <medium stock="a4" short="210mm" long="297mm"/>
    <?templateDesigner expand 1?></pageArea>
    <?templateDesigner expand 1?></pageSet>
    <subform w="197.3mm" layout="tb">
    <subform name="Subform1" w="190.5mm" h="25.4mm">
    <field name="Button1" y="15.875mm" x="60.325mm" w="28.575mm" h="6mm">
    <ui>
    <button highlight="inverted"/>
    </ui>
    <font typeface="Myriad Pro"/>
    <caption>
    <value>
    <text>Add Row</text>
    </value>
    <para vAlign="middle" hAlign="center"/>
    </caption>
    <border hand="right">
    <?templateDesigner StyleID apbx2?>
    <edge stroke="raised"/>
    <fill/>
    </border>
    <bind match="none"/>
    <event activity="click" name="event__click">
    <script contentType="application/x-javascript">
    try
    Subform2.Table1._Row1.addInstance(1);
    //for(var i=0;i&lt;Subform2.Table1._Row1.count;i++)
    //xfa.resolveNode("Subform2.Table1.Row1["+i+"].Total").execEvent("exit");
    }catch(e)
    app.alert(e)
    </script>
    </event>
    </field>
    <?templateDesigner expand 1?></subform>
    <subform name="Subform2" w="196.85mm">
    <subform name="Table1" layout="table" columnWidths="55.916mm 44.47mm" x="38.1mm" y="12.7mm">
    <border>
    <edge/>
    </border>
    <subform layout="row" name="HeaderRow" id="HeaderRow_ID">
    <assist role="TH"/>
    <draw h="10mm" name="Cell1">
    <border>
    <edge/>
    <corner thickness="0.1778mm"/>
    </border>
    <ui>
    <textEdit/>
    </ui>
    <value>
    <text>Quantity</text>
    </value>
    <font typeface="Myriad Pro"/>
    <margin topInset="0.5mm" bottomInset="0.5mm" leftInset="0.5mm" rightInset="0.5mm"/>
    <para vAlign="middle" hAlign="center"/>
    </draw>
    <draw h="10mm" name="Cell2">
    <border>
    <edge/>
    <corner thickness="0.1778mm"/>
    </border>
    <ui>
    <textEdit/>
    </ui>
    <value>
    <text>Total</text>
    </value>
    <font typeface="Myriad Pro"/>
    <margin topInset="0.5mm" bottomInset="0.5mm" leftInset="0.5mm" rightInset="0.5mm"/>
    <para vAlign="middle" hAlign="center"/>
    </draw>
    <border>
    <edge presence="hidden"/>
    </border>
    <occur max="-1"/>
    <?templateDesigner expand 1?></subform>
    <subform layout="row" name="Row1">
    <assist role="TR"/>
    <field name="Quantity" w="55.916mm" h="9.317mm">
    <ui>
    <numericEdit>
    <border presence="hidden">
    <?templateDesigner StyleID aped0?></border>
    <margin/>
    </numericEdit>
    </ui
    ><
    font typeface="Myriad Pro"/><
    margin topInset="1mm" bottomInset="1mm" leftInset="1mm" rightInset="1mm"/><
    para vAlign="middle"/><
    border><
    edge/><
    corner thickness="0.1778mm"/></
    border></
    field><
    field name="Total" w="44.47mm" h="9.317mm" access="readOnly"><
    ui><
    numericEdit><
    border presence="hidden"> 
    <?templateDesigner StyleID aped0?>
    </border><
    margin/></
    numericEdit></
    ui><
    font typeface="Myriad Pro"/><
    margin topInset="1mm" bottomInset="1mm" leftInset="1mm" rightInset="1mm"/><para vAlign="middle"/>
    <border>
    <edge/>
    <corner thickness="0.1778mm"/>
    </border>
    <calculate>
    <script contentType="application/x-javascript">
    try
    var nextRow = xfa.resolveNode("Subform2.Table1.Row1["+(this.parent.instanceIndex+1)+"]"); // Next row of the table
    if((nextRow==null || nextRow.Quantity.rawValue == null || nextRow.Quantity.rawValue=="") &amp;&amp; Quantity.rawValue!=null) // If there is no more rows OR the next row don't contain any Quantity value
    var subTotal = 0;
    for(var j=this.parent.instanceIndex;j&gt;=0;j--) // Loop until the previous row has empty value OR reach start of row Index (i.e. 0)
    var prevObj = xfa.resolveNode("Subform2.Table1.Row1["+j+"].Quantity"); // locate the previous row's Quantity object
    if(prevObj.rawValue == null || prevObj.rawValue=="")
    break; // if blank value found, skip the loop
    subTotal+= prevObj.rawValue;
    this.rawValue = subTotal; // Update the Total value
    }else
    this.rawValue = null; // Clear the total value
    }catch(e)
    app.alert(e)
    </script>
    </calculate>
    </field>
    <border>
    <edge presence="hidden"/>
    </border>
    <occur max="-1"/>
    <?templateDesigner expand 1?></subform>
    <keep intact="contentArea"/>
    <?templateDesigner rowpattern first:1, next:1, firstcolor:f0f0f0, nextcolor:ffffff, apply:0?>
    <overflow leader="HeaderRow"/>
    <?templateDesigner expand 1?></subform>
    <?templateDesigner expand 1?></subform>
    <?templateDesigner expand 1?></subform>
    <proto/>
    <desc>
    <text name="version">9.0.0.0.20091029.1.612548.606130</text>
    </desc>
    <?templateDesigner expand 1?></subform>
    <?templateDesigner DefaultPreviewDynamic 1?>
    <?templateDesigner DefaultRunAt client?>
    <?templateDesigner Grid show:1, snap:1, units:0, color:ff8080, origin:(0,0), interval:(125000,125000)?>
    <?templateDesigner FormTargetVersion 28?>
    <?templateDesigner DefaultLanguage JavaScript?>
    <?acrobat JavaScript strictScoping?>
    <?templateDesigner Zoom 62?>
    <?templateDesigner Rulers horizontal:1, vertical:1, guidelines:1, crosshairs:0?>
    <?templateDesigner SaveTaggedPDF 1?>
    <?templateDesigner SavePDFWithEmbeddedFonts 1?></template>
    <config xmlns="http://www.xfa.org/schema/xci/2.8/">
    <agent name="designer">
    <!-- [0..n] -->
    <destination>pdf</destination>
    <pdf>
    <!-- [0..n] -->
    <fontInfo/>
    </pdf>
    </agent>
    <present>
    <!-- [0..n] -->
    <pdf>
    <!-- [0..n] -->
    <fontInfo/>
    <version>1.7</version>
    <adobeExtensionLevel>3</adobeExtensionLevel>
    </pdf>
    <xdp>
    <packets>*</packets>
    </xdp>
    </present>
    </config>
    <localeSet xmlns="http://www.xfa.org/schema/xfa-locale-set/2.7/">
    <locale name="en_US" desc="English (United States)">
    <calendarSymbols name="gregorian">
    <monthNames>
    <month>January</month>
    <month>February</month>
    <month>March</month>
    <month>April</month>
    <month>May</month>
    <month>June</month>
    <month>July</month>
    <month>August</month>
    <month>September</month>
    <month>October</month>
    <month>November</month>
    <month>December</month>
    </monthNames>
    <monthNames abbr="1">
    <month>Jan</month>
    <month>Feb</month>
    <month>Mar</month>
    <month>Apr</month>
    <month>May</month>
    <month>Jun</month>
    <month>Jul</month>
    <month>Aug</month>
    <month>Sep</month>
    <month>Oct</month>
    <month>Nov</month>
    <month>Dec</month>
    </monthNames>
    <dayNames>
    <day>Sunday</day>
    <day>Monday</day>
    <day>Tuesday</day>
    <day>Wednesday</day>
    <day>Thursday</day>
    <day>Friday</day>
    <day>Saturday</day>
    </dayNames>
    <dayNames abbr="1">
    <day>Sun</day>
    <day>Mon</day>
    <day>Tue</day>
    <day>Wed</day>
    <day>Thu</day>
    <day>Fri</day>
    <day>Sat</day>
    </dayNames>
    <meridiemNames>
    <meridiem>AM</meridiem>
    <meridiem>PM</meridiem>
    </meridiemNames>
    <eraNames>
    <era>BC</era>
    <era>AD</era>
    </eraNames>
    </calendarSymbols>
    <datePatterns>
    <datePattern name="full">EEEE, MMMM D, YYYY</datePattern>
    <datePattern name="long">MMMM D, YYYY</datePattern>
    <datePattern name="med">MMM D, YYYY</datePattern>
    <datePattern name="short">M/D/YY</datePattern>
    </datePatterns>
    <timePatterns>
    <timePattern name="full">h:MM:SS A Z</timePattern>
    <timePattern name="long">h:MM:SS A Z</timePattern>
    <timePattern name="med">h:MM:SS A</timePattern>
    <timePattern name="short">h:MM A</timePattern>
    </timePatterns>
    <dateTimeSymbols>GyMdkHmsSEDFwWahKzZ</dateTimeSymbols>
    <numberPatterns>
    <numberPattern name="numeric">z,zz9.zzz</numberPattern>
    <numberPattern name="currency">$z,zz9.99|($z,zz9.99)</numberPattern>
    <numberPattern name="percent">z,zz9%</numberPattern>
    </numberPatterns>
    <numberSymbols>
    <numberSymbol name="decimal">.</numberSymbol>
    <numberSymbol name="grouping">,</numberSymbol>
    <numberSymbol name="percent">%</numberSymbol>
    <numberSymbol name="minus">-</numberSymbol>
    <numberSymbol name="zero">0</numberSymbol>
    </numberSymbols>
    <currencySymbols>
    <currencySymbol name="symbol">$</currencySymbol>
    <currencySymbol name="isoname">USD</currencySymbol>
    <currencySymbol name="decimal">.</currencySymbol>
    </currencySymbols>
    <typefaces>
    <typeface name="Myriad Pro"/>
    <typeface name="Minion Pro"/>
    <typeface name="Courier Std"/>
    <typeface name="Adobe Pi Std"/>
    <typeface name="Adobe Hebrew"/>
    <typeface name="Adobe Arabic"/>
    <typeface name="Adobe Thai"/>
    <typeface name="Kozuka Gothic Pro-VI M"/>
    <typeface name="Kozuka Mincho Pro-VI R"/>
    <typeface name="Adobe Ming Std L"/>
    <typeface name="Adobe Song Std L"/>
    <typeface name="Adobe Myungjo Std M"/>
    </typefaces>
    </locale>
    </localeSet>
    <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.2.1-c043 52.398682, 2009/08/10-13:00:47 ">
    <
    rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><
    rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about=""><
    xmp:MetadataDate>2012-02-28T14:04:54Z</xmp:MetadataDate><
    xmp:CreatorTool>Adobe LiveCycle Designer ES 9.0</xmp:CreatorTool></
    rdf:Description><
    rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about=""><
    pdf:Producer>Adobe LiveCycle Designer ES 9.0</pdf:Producer></
    rdf:Description><
    rdf:Description xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" rdf:about=""><
    xmpMM:DocumentID>uuid:2c561cdf-3377-4e84-9a89-51e740bb2fea</xmpMM:DocumentID></
    rdf:Description><
    rdf:Description xmlns:desc="http://ns.adobe.com/xfa/promoted-desc/" rdf:about=""><
    desc:version rdf:parseType="Resource"><
    rdf:value>9.0.0.0.20091029.1.612548.606130</rdf:value><
    desc:ref>/template/subform[1]</desc:ref></
    desc:version></
    rdf:Description></
    rdf:RDF></
    x:xmpmeta></xdp:xdp>

  • Copying values from a row to a current row

    hi all, i have a complex scenario here. i have a table that has the following data.
    WITH table1 AS
      SELECT 111 the_id,  To_Date('6/30/2009','mm/dd/yyyy') dt,  93 src, 'A-C' the_name, 'AA' cod, 'BB' pad, ' CC' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('10/1/2009','mm/dd/yyyy') dt,  93 src, 'B-L' the_name, 'AA' cod, 'NN' pad, ' TT' tek FROM dual UNION all
      SELECT 111 the_id,  To_Date('10/2/2009','mm/dd/yyyy') dt,  93 src, 'C-H' the_name, 'BA' cod, 'RR' pad, ' BAN' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('10/5/2009','mm/dd/yyyy') dt,  93 src, 'D-R' the_name, 'HH' cod, 'FCY' pad, ' BANW' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('10/6/2009','mm/dd/yyyy') dt,  93 src, 'E-C' the_name, 'JJ' cod, 'EE' pad, ' JJ' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('10/7/2009','mm/dd/yyyy') dt,  93 src, 'F-L' the_name, 'DD' cod,  null pad, ' BAN' tek FROM dual UNION all
      SELECT 111 the_id,  To_Date('10/8/2009','mm/dd/yyyy') dt,  93 src, 'G-H' the_name, 'HG' cod, 'YY' pad, ' BAN' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('10/9/2009','mm/dd/yyyy') dt,  93 src, 'K-R' the_name, 'EE' cod, 'FCY' pad, ' BANW' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('7/31/2009','mm/dd/yyyy') dt,  93 src, 'G-H' the_name, 'HG' cod, 'YY' pad, ' BAN' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('8/3/2009','mm/dd/yyyy') dt,  93 src, 'K-R' the_name, 'EE' cod, 'FCY' pad, ' BANW' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('8/4/2009','mm/dd/yyyy') dt,  93 src, 'K-R' the_name, 'EE' cod, 'FCY' pad, ' BANW' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('8/5/2009','mm/dd/yyyy') dt,  93 src, 'K-R' the_name, 'EE' cod, 'FCY' pad, ' BANW' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('8/6/2009','mm/dd/yyyy') dt,  93 src, 'K-R' the_name, 'EE' cod, 'FCY' pad, ' BANW' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('8/7/2009','mm/dd/yyyy') dt,  93 src, 'K-R' the_name, 'EE' cod, 'FCY' pad,  null tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('6/30/2009','mm/dd/yyyy') dt,  22 src, 'A-C' the_name, 'AA' cod, 'BB' pad, ' CC' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('10/1/2009','mm/dd/yyyy') dt,  22 src, 'B-L' the_name, 'AA' cod, 'NN' pad, ' TT' tek FROM dual UNION all
      SELECT 111 the_id,  To_Date('10/2/2009','mm/dd/yyyy') dt,  22 src, 'C-H' the_name, 'BA' cod, 'RR' pad, ' BAN' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('10/5/2009','mm/dd/yyyy') dt,  22 src, 'D-R' the_name, 'HH' cod, 'FCY' pad, ' BANW' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('10/6/2009','mm/dd/yyyy') dt,  22 src, 'E-C' the_name, 'JJ' cod, 'EE' pad, ' JJ' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('10/7/2009','mm/dd/yyyy') dt,  22 src, 'F-L' the_name, 'DD' cod, 'FIC' pad, ' BAN' tek FROM dual UNION all
      SELECT 111 the_id,  To_Date('10/8/2009','mm/dd/yyyy') dt,  22 src, 'G-H' the_name, 'HG' cod, 'YY' pad, ' BAN' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('10/9/2009','mm/dd/yyyy') dt,  22 src, 'K-R' the_name, 'EE' cod, 'FCY' pad, ' BANW' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('10/30/2009','mm/dd/yyyy') dt, 168 src, 'T-C' the_name, 'WW' cod, 'AA' pad, ' NN' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('11/2/2009','mm/dd/yyyy') dt,  168 src, 'Y-L' the_name, 'HH' cod, 'AA' pad, ' BAN' tek FROM dual UNION all
      SELECT 111 the_id,  To_Date('11/3/2009','mm/dd/yyyy') dt,  168 src, 'G-H' the_name, 'BA' cod, 'WW' pad, ' BAN' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('11/4/2009','mm/dd/yyyy') dt,  168 src, 'E-R' the_name, 'JJ' cod, 'XX' pad, ' DD' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('11/5/2009','mm/dd/yyyy') dt,  168 src, 'T-C' the_name, 'TT' cod, 'JJ' pad, ' WW' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('11/6/2009','mm/dd/yyyy') dt,  168 src, 'H-L' the_name, 'EE' cod, 'DD' pad, ' BAN' tek FROM dual UNION all
      SELECT 111 the_id,  To_Date('11/9/2009','mm/dd/yyyy') dt,  168 src, 'S-H' the_name, 'BA' cod, 'WW' pad, ' BAN' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('11/10/2009','mm/dd/yyyy') dt, 168 src, 'H-R' the_name, 'VV' cod, 'FCY' pad, ' YY' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('11/30/2009','mm/dd/yyyy') dt,  90 src, 'V-C' the_name, 'GG' cod, 'FCS' pad, ' BAN' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('12/1/2009','mm/dd/yyyy') dt,  90 src, 'B-L' the_name, 'QQ' cod, 'GG' pad, ' BAN' tek FROM dual UNION all
      SELECT 111 the_id,  To_Date('12/2/2009','mm/dd/yyyy') dt,  90 src, 'A-H' the_name, 'BA' cod, 'WW' pad, ' BAN' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('12/3/2009','mm/dd/yyyy') dt,  90 src, 'N-R' the_name, 'TT' cod, 'JJ' pad, ' TT' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('12/7/2009','mm/dd/yyyy') dt,  90 src, 'C-C' the_name, 'YY' cod, 'QQ' pad, ' WE' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('12/8/2009','mm/dd/yyyy') dt,  90 src, 'X-L' the_name, 'UU' cod, 'JJ' pad, ' BAN' tek FROM dual UNION all
      SELECT 111 the_id,  To_Date('12/9/2009','mm/dd/yyyy') dt,  90 src, 'V-H' the_name, 'BA' cod, 'PP' pad, ' YR' tek FROM dual UNION ALL
      SELECT 111 the_id,  To_Date('12/10/2009','mm/dd/yyyy') dt,  90 src, 'E-R' the_name, 'FIN2' cod, 'FCY' pad, ' RE' tek FROM dual UNION ALL
      SELECT 112 the_id,  To_Date('2/28/2009','mm/dd/yyyy') dt,  93 src, 'V-C' the_name, 'EE' cod, 'FCS' pad, ' BAN' tek FROM dual UNION ALL
      SELECT 112 the_id,  To_Date('3/2/2009','mm/dd/yyyy') dt,  93 src, 'A-S' the_name, 'BA' cod, 'WW' pad, ' TT' tek FROM dual UNION ALL
      SELECT 112 the_id,  To_Date('3/3/2009','mm/dd/yyyy') dt,  93 src, 'N-R' the_name, 'TT' cod, 'JJ' pad, ' TT' tek FROM dual UNION ALL
      SELECT 112 the_id,  To_Date('3/4/2009','mm/dd/yyyy') dt,  93 src, 'C-C' the_name, 'YY' cod, 'QQ' pad, ' WE' tek FROM dual UNION ALL
      SELECT 112 the_id,  To_Date('3/5/2009','mm/dd/yyyy') dt,  93 src, 'X-L' the_name, 'SS' cod, 'JJ' pad, ' BAN' tek FROM dual UNION all
      SELECT 112 the_id,  To_Date('3/6/2009','mm/dd/yyyy') dt,  93 src, 'V-H' the_name, 'BA' cod, 'PP' pad, ' YR' tek FROM dual UNION ALL
      SELECT 112 the_id,  To_Date('3/9/2009','mm/dd/yyyy') dt,  93 src, 'E-R' the_name, 'HH' cod, 'KK' pad, ' RE' tek FROM dual
    )so as you can see, there are month end dates and well and daily dates. the daily are basically business days. what i want to do is the following
    for a particular id, i would like to take the month end date, look forward 5 business day and copy the column values from the 5th business day
    to the current row.
    there is two exceptions:
    1. i am only interested on those src=93 and 168.
    2. the_name column will not be copy, but the rest will
    so lets take an example, id = 111 src = 93. since i am only interested in src=93 and 168, this data fall in that category.
    the month end dates for id=111 and src=93 are 6/30/09 and 7/31/2009.
    in this case i want to look forward 5 business days. in the case of 6/30/09, the 5th business day is 10/7/2009 and for 7/31/2009 is 8/7/2009.
    i want to take all the column values except the_name column and display those values for 6/30/09. same thing with 7/31/2009, take column values from 8/7/2009
    and display those values.
    so the output for 6/30/2009 should look like this
    THE_ID     DT            SRC     THE_NAME     COD       PAD      TEK
    111         6/30/2009     93     A-C           DD               BANif ou notice here 6/30/2009 retain the value for the_name column but took the values for the remaining column from 10/7/2009 (even the null values got copy)
    the same logic should apply to 7/31/2009 and value should be taking from 8/7/2009
    if the src is not equal to 93 or 168. then just display the data and no logic apply, for id=111 and src=90
    no logic apply, the data should just be display.
    i would like to write a query tha give me the output below.
    i tried using last_value function but i am using oracle 9i and ignore null is not supported in oracle 9i. i need to copy null if the 5th day contain null in the columns
    the final ouput for the data above should be this
    THE_ID     DT             SRC     THE_NAME     COD     PAD     TEK
    111         6/30/2009       93     A-C           DD            BAN
    111         10/1/2009       93     B-L           AA     NN      TT
    111         10/2/2009       93     C-H           BA     RR      BAN
    111         10/5/2009       93     D-R           HH     FCY      BANW
    111         10/6/2009       93     E-C           JJ     EE      JJ
    111         10/7/2009       93     F-L           DD     FIC      BAN
    111         10/8/2009       93     G-H           HG     YY      BAN
    111         10/9/2009       93     K-R           EE     FCY      BANW
    111         7/31/2009       93     G-H           EE     FCY
    111         8/3/2009       93     K-R          EE     FCY      BANW
    111         8/4/2009       93     K-R           EE     FCY      BANW
    111         8/5/2009       93     K-R           EE     FCY      BANW
    111         8/6/2009       93     K-R          EE     FCY      BANW
    111         8/7/2009       93     K-R           EE     FCY
    111         6/30/2009       22     A-C           AA     BB      CC
    111         10/1/2009       22     B-L           AA     NN      TT
    111         10/2/2009       22     C-H           BA     RR      BAN
    111         10/5/2009       22     D-R           HH     FCY      BANW
    111         10/6/2009       22     E-C           JJ     EE      JJ
    111         10/7/2009       22     F-L          DD     FIC      BAN
    111         10/8/2009       22     G-H          HG     YY      BAN
    111         10/9/2009       22     K-R           EE     FCY      BANW
    111         10/30/2009     168     T-C           EE     DD      BAN
    111         11/2/2009       168     Y-L           HH     AA      BAN
    111         11/3/2009       168     G-H           BA     WW      BAN
    111         11/4/2009       168     E-R           JJ     XX      DD
    111         11/5/2009       168     T-C           TT     JJ      WW
    111         11/6/2009       168     H-L          EE     DD      BAN
    111         11/9/2009       168     S-H          BA     WW      BAN
    111         11/10/2009     168     H-R           VV     FCY      YY
    111         11/30/2009     90     V-C           GG     FCS      BAN
    111         12/1/2009       90     B-L           QQ     GG      BAN
    111         12/2/2009       90     A-H           BA     WW      BAN
    111         12/3/2009       90     N-R           TT     JJ      TT
    111         12/7/2009       90     C-C           YY     QQ      WE
    111         12/8/2009       90     X-L           UU     JJ      BAN
    111         12/9/2009       90     V-H           BA     PP      YR
    111         12/10/2009     90     E-R           FIN2 FCY      RE
    112         2/28/2009     93       V-C           BA     PP      YR
    112         3/2/2009     93       A-S           BA     WW      TT
    112         3/3/2009     93       N-R           TT     JJ      TT
    112         3/4/2009     93       C-C           YY     QQ      WE
    112         3/5/2009     93       X-L           SS     JJ      BAN
    112         3/6/2009     93       V-H           BA     PP      YR
    112         3/9/2009     93       E-R           HH     KK      RE

    hi i am using oracle 9i 9.2.0.7.0
    you are right about the 5th business day, for 6/30/2010 it should have been 8/7/2010. 7/31/2010 is a month end so it doesnt count when you go down the list of business days. and for 7/31/2010 the 5th business day should have been 10/7/2010.
    sorry for the mistake, i got both of them backwards. so for the output, 6/30/2010 should copy from 8/7/2010 and 7/31/2010 from 10/7/2010
    THE_ID     DT             SRC     THE_NAME     COD     PAD     TEK
    111         6/30/2009       93     A-C           EE    FCY
    111         8/3/2009       93     K-R          EE     FCY      BANW
    111         8/4/2009       93     K-R           EE     FCY      BANW
    111         8/5/2009       93     K-R           EE     FCY      BANW
    111         8/6/2009       93     K-R          EE     FCY      BANW
    111         8/7/2009       93     K-R           EE     FCY
    111         7/31/2009       93     G-H           DD              BAN
    111         10/1/2009       93     B-L           AA     NN      TT
    111         10/2/2009       93     C-H           BA     RR      BAN
    111         10/5/2009       93     D-R           HH     FCY      BANW
    111         10/6/2009       93     E-C           JJ     EE      JJ
    111         10/7/2009       93     F-L           DD             BAN
    111         10/8/2009       93     G-H           HG     YY      BAN
    111         10/9/2009       93     K-R           EE     FCY      BANWEdited by: elmasduro on May 10, 2010 11:53 AM

  • Interchange values from one row with another row

    Dear Oracle Guru's
    While Migrating data from legacy system, there was a confusion and data in two columns got jumbled
    Ex The data should be like this
    Custcode leaseno
    1034 A234
    1035 A235
    1036 A236
    whereas the table has data like this
    Custcode leaseno
    1034 A235
    1035 A234
    1036 A237
    1037 A236
    How do we swap values between two rows
    Kindly guide me on this
    With Warm Regards
    ssr

    >
    Ex The data should be like this
    Custcode leaseno
    1034 A234
    1035 A235
    1036 A236
    whereas the table has data like this
    Custcode leaseno
    1034 A235
    1035 A234
    1036 A237
    1037 A236
    How do we swap values between two rows And now, time for yet another guess... ;)
    My guess is that your migration program interchanged "leaseno" value in pairs from the top - the top being the least value of "custcode".
    So, the "leaseno" values of Row 1 and Row 2 were swapped.
    The "leaseno" values of Row 3 and Row 4 were swapped.
    And so on.
    Which also means that if the total number of rows in your table is even, then the swap would be "complete". Otherwise, the last row would be left out. I don't know what you want to do with that.
    test@XE>
    test@XE> select * from t;
      CUSTCODE LEAS
          1034 A235
          1035 A234  <= you want to swap A235 and A234
          1036 A237
          1037 A236  <= you want to swap A237 and A236
          1038 A238  <= let's leave it hanging there...
    5 rows selected.
    test@XE>
    test@XE> And of course, swapping from "top to bottom" means swapping from the least to highest value of "custcode".
    Here's the SELECT statement for that -
    test@XE>
    test@XE> -- show the records in the table t
    test@XE>
    test@XE> select * from t;
      CUSTCODE LEASENO
          1034 A235
          1035 A234
          1036 A237
          1037 A236
          1038 A238
    5 rows selected.
    test@XE>
    test@XE> -- the SELECT statement for swapping leaseno values
    test@XE>
    test@XE> @test7a
    test@XE> --
    test@XE> select custcode,
      2         leaseno,
      3         case
      4           when mod(row_number() over (order by custcode),2) = 1 and
      5                lead(leaseno) over (order by custcode) is null
      6           then leaseno
      7           when mod(row_number() over (order by custcode),2) = 1
      8           then lead(leaseno) over (order by custcode)
      9           else lag(leaseno) over (order by custcode)
    10         end as new_leaseno
    11  from t;
      CUSTCODE LEASENO NEW_LEASENO
          1034 A235    A234
          1035 A234    A235
          1036 A237    A236
          1037 A236    A237
          1038 A238    A238
    5 rows selected.
    test@XE>
    test@XE> And here's the update statement -
    test@XE>
    test@XE> -- the UPDATE statement for updating leaseno values in pairs from the top
    test@XE>
    test@XE> @test7b
    test@XE> --
    test@XE> update t t1
      2  set t1.leaseno = (
      3    select new_leaseno
      4    from (
      5      select custcode,
      6             leaseno,
      7             case
      8             when mod(row_number() over (order by custcode),2) = 1 and
      9                  lead(leaseno) over (order by custcode) is null
    10             then leaseno
    11             when mod(row_number() over (order by custcode),2) = 1
    12             then lead(leaseno) over (order by custcode)
    13             else lag(leaseno) over (order by custcode)
    14           end as new_leaseno
    15      from t
    16    ) t2
    17    where t2.custcode = t1.custcode
    18  );
    5 rows updated.
    test@XE>
    test@XE>
    test@XE> select * from t;
      CUSTCODE LEASENO
          1034 A234
          1035 A235
          1036 A236
          1037 A237
          1038 A238
    5 rows selected.
    test@XE>
    test@XE> HTH,
    isotope

  • Getting values from datatable row action

    Hi,
    I have a data table defined to load dynamic values. It works fine. Now I want to add a Row Action and then after clicking it it should be forwarded to the next page which displays other details of the row.
    Now the problem is I dont understand how can i fetch a particular column value in the doRowAction method. I know this is a very basic question but please help!!..

    Not sure where you're talking about with "doRowAction()" but this article might give useful background information and new insights: http://balusc.blogspot.com/2006/06/using-datatables.html

  • Poplist and displaying corresponding values from the database table

    Hi
    I have a poplist in a control block, the values of which are populated using a procedure. This is called in when-new-form-instance.
    This part works fine and values are filled in the poplist when form is opened..
    The datablock is based on a view. 3 columns from the view are selected to be displayed.
    Also the databock is filled with all values (for selected columns)
    Now when the poplist value is changed, I need the values in the datablock to be changed as well, but this is not happening.
    In my when-list-changed trigger, I have:
    go_block('datablock');
    execute_query;Please tell , where and what should I add to display the datablock values as per the poplist value.
    i.e, something like,
    select col1,col2,col3 from <view> where col4 =:control.col4
    Note:I tried in the where clause property of the block, but then nothing is displayed in the datablock
    Thanks

    This does not work , either..
    Before, when I changed the values from the list, it was still displaying same data on datablock always(all records)
    Now when I give this code,data is displayed in datablock only once(first time when the form opens)
    I have defined the Query data source type property on data block as "Table" but infact this datablock is based on a view..is this correct?
    Anything else I could try?

  • How to display the values from the table in the screen

    Hi,
    I have created a screen where i will enter the values for the field treshold amount and desc and if i press update button  .it will update the new values by overriting the existing values .
    Now i have got requirement i need to create a button show which will display the existing value from the table. always there will be only one entry...in this table
    Please can one give me idea...to do this
    or sample code...thanks in advance
    regards
    paveeeeee

    Define a function code 'SHOW' for your button. In your PAI module, when you check for various sy-ucomms, check for 'SHOW' also.
    Your code will be like this:
    Case sy-ucomm.
      when 'SHOW'.
         perform show_details.
    endcase.
    In the perform, you can fetch the data from the table and put it in global variables. In the PBO, move the data from the global variables to the screen fields so that they get displayed on the screen.
    Hope this helps. Reward points for useful answers.
    Regards
    Nithya

  • Retrieving column value from multiselect managed metadata column and updating metadat column in list.

    I have Library having metadata column when a document is uploaded i need update another list with metadata column of
    library in list.I have an event reciever to do that,Code is given below
    public override void ItemUpdated(SPItemEventProperties properties)
                base.ItemUpdated(properties);
                    SPList saList = properties.Web.Lists["mylist"];
                    SPListItem item = saList.AddItem();
                    item["Department"] = properties.ListItem["Department"].ToString();
                    EventFiringEnabled = false;
                    item.Update();
                    EventFiringEnabled = true;   
    my elements.xml file is as below
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <Receivers ListUrl="Documents">
          <Receiver>
            <Name>DocumentItemUpdated</Name>
            <Type> ItemUpdated</Type>
            <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
            <Class>MyDocuments.Documents.Documents</Class>
            <SequenceNumber>10000</SequenceNumber>
          </Receiver>
      </Receivers>
    </Elements>
    but i did not see the the List column getting updated.But when i use the code to update a column of single line of text
    it works fine.But when i do it for multi select metadata column in debug mode i could see its giving null value even though Library had column value.
    Any pointers on how to update Multiselect metadata column programatically on itemeadding event in library to a list will
    be helpful.

    You need to use the TaxonomyFieldValueCollection class. The following code is from SP2010 but should still apply in SP2013. It is an example of updating multivalued taxonomy fields.
    public static void SetListItemMultiMetaDataColumn(Int32 id)
    using (SPSite site = new SPSite("http://basesmc2008"))
    using (SPWeb web = site.OpenWeb())
    TermSet termSet = null;
    TaxonomySession txs = new TaxonomySession(site);
    SPList list = web.Lists["Shared Documents"] as SPList;
    SPListItem item = list.GetItemById(id);
    TaxonomyField field = item.Fields["multimanage"] as TaxonomyField;
    if (field != null)
    termSet = txs.DefaultSiteCollectionTermStore.GetTermSet(field.TermSetId);
    Term term = termSet.GetTerms("sts", false).FirstOrDefault();
    if (field.AllowMultipleValues)
    TaxonomyFieldValueCollection currentCollection = item[field.Id] as TaxonomyFieldValueCollection;
    TaxonomyFieldValue tfv = new TaxonomyFieldValue(field);
    tfv.TermGuid = term.Id.ToString();
    tfv.Label = term.GetPath();
    tfv.WssId = TaxonomyField.GetWssIdsOfTerm(site, txs.DefaultSiteCollectionTermStore.Id, termSet.Id, term.Id, false, 1).First();
    currentCollection.Add(tfv);
    field.SetFieldValue(item, currentCollection);
    item.Update();
    Blog |SharePoint Field Notes Dev Tool |
    SPFastDeploy

Maybe you are looking for