Averaging selected range based on value of another channel

I have one channel, X, with a bunch of integer values from 0 to 90. I also have another channel with various corresponding data, lets call it Y. I would like to find the average and standard deviation for all of the values in Y that have a 0 in its corresponding X row, then the same for all values in Y that have a 1 in its corresponding row and etc, all the way up to 90. Is there an easy way to do this? Perhaps there is a way to sort the data and put all the Y values into new channels that are grouped according to their X values?

Hi Martin,
You have a couple of options.  You could indeed use the FormulaCalc() command to split out various rows from your data channel that all have the same index into a new data channel and do this for each index.  Alternatively, you could determine which rows contain a certain index, then use the StatBlockCalc() function to determine statistics from only these rows of your data channel:
Dim Channel, Msg
Channel = "[1]/Time"
For i = 1 To 22
  StatSel(i) = "No"
Next
StatSel(4)  = "Yes" ' Minimum
StatSel(5)  = "Yes" ' Maximum
StatSel(6)  = "Yes" ' Arith. mean
StatSel(14) = "Yes" ' Standard Deviation
Call StatBlockCalc("Channel", "1-13", Channel)
Msg = Msg & "Min = " & StatMin        & vbCRLF
Msg = Msg & "Ave = " & StatArithMean  & vbCRLF
Msg = Msg & "Max = " & StatMax        & vbCRLF
Msg = Msg & "Dev = " & StatDeviation
MsgBox Msg
Note that if you have DIAdem 10.1 you should loop up to 23,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

Similar Messages

  • Select LOV based on value in another table

    Hi all,
    I have an issue,
    I have an item with Select list with dynamic query in the dropdown ListofValues.
    but i want to use a condition like
    select val1 display_value val2 return_value
    from table2
    where value_in_table1 = username AND table_id1=table_id2
    in these two tables i have the id's common and table 1 is having the usernames.
    Can somebody help me in solving this issue please.
    Thanks in advance

    As far as I know, you can't dump PL/SQL into the list of values definition. Try just having select distinct PJT_NAME display_value, PROJECT_ID return_value from EZS_PROJECTS WHERE EMP_ID = :P1_XYZ ORDER BY 1

  • How to create a new row for a VO based on values from another VO?

    Hi, experts.
    in jdev 11.1.2.3,
    How to create a new row for VO1 based on values from another VO2 in the same page?
    and in my use case it's preferable to do this from the UI rather than from business logic layer(EO).
    Also I have read Frank Nimphius' following blog,but in his example the source VO and the destination VO are the same.
    How-to declaratively create new table rows based on existing row content (20-NOV-2008)
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/13-create-with-params-169140.pdf
    I have tried:
    1.VO1(id,amount,remark1) and VO2(id,amount,remark2) are based on different EO,but render in same page,
    2.Drag and drop a Createwithparams button for VO1(id,amount,remark),
    3.add: Create insertinside Createwithparams->Nameddata(amount),
    4.set NDName:amount, NDValue:#{bindings.VO2.children.Amount}, NDtype:oracle.jbo.domain.Number.
    On running,when press button Createwithparams, cannot create a new row for VO1, and get error msg:
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: For input string: "Amount"
    java.lang.NumberFormatException: For input string: "Amount"
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    Can anyone give some suggestions?
    Thanks in advance.
    bao
    Edited by: user6715237 on 2013-4-19 下午9:29

    Hi,CM,
    I'm really very appreciated for your quick reply! You know, today is Saturday, it's not a day for everyone at work.
    My principal requirement is as follows:
    1.select/check some rows from VO2, and for each selection create a new row with some attributes from VO2 as default values for VO1's corresponding attributes, and during this process the user may be cancel/uncheck or redo some of the selections.
    --so it's better to implement it in UI rather than in EO.
    2.it's better to implement this function with declarative way as in Frank Nimphius' blog.
    --little Jave/JS coding, the better. I only have experience in ORACLE FORMS, little experience in JAVA/JS.
    In order to get full information for the requirements of my use case, can take a check at:
    How to set default value for a VO query bind variable in a jspx page?
    (the end half of the thread: I have a more realworld requirement similar to the above requirement is:
    Manage bank transactions for clients. and give invoices to clients according to their transaction records. One invoice can contain one or many transactions records. and one transaction records can be split into many invoices.
    Regards
    bao
    Edited by: user6715237 on 2013-4-19 下午11:18
    JAVE->JAVA

  • Conditional inclusion of column cells based on value in another column?

    I was wondering if something like the following is possible -- I've looked through the forums and Numbers user guide but can't figure it out:
    Suppose I have a column A of sales figures, and columns B and C which basically have different attributes (say, color (yellow or green), size (small or large), and material (cotton or polyester)).
    I want to run basic statistics on various combinations: e.g. all yellow items regardless of size, all green cotton items regardless of size, all large yellow items regardless of material, etc.
    I want to be able to specify something like this:
    'Compute the average of every cell in column A where column B=="green" and column C=="large"'
    Is there a good way to go about doing this? Would I want to attack the problem using categories, sorting, and multiple tables? Or is there a way to conditionally include cell values from a range based on the value of that row's cell in another column?
    Thanks for any help.

    All I can think of to solve the quartile and median functions is to have another table of the same size as your original table that gets populated with just the items that match. Then you can do the quartile and median (and average) on that table. It's a one-at-a-time affair; you can only do one selection of size, color, and/or material at a time but you can get the median, mean, and quartiles of it. Of course, you could have multiple copies of this second table if you want to do more than one comparison at a time.
    In the attached file, unhide the hidden rows in Table 2 to see the formulas that do all the work.
    [files.me.com/pwb3/6hobt0.numbers.zip]
    Message was edited by: Badunit
    Message was edited by: Badunit

  • Color a column based on value in another column in tableview

    I am using a tableview iterator to display data in a bsp page. I want to color a cell in particular column (column 4), when a value in another column (column 2) on that same row is greater than 20. I can color the cell in column 2 but am not able to color the cell in column 4. How can I accomplish this?
    This is what I have. Looks like val1 is losing it's value.
    CASE p_column_index.
        WHEN 2.
          ASSIGN p_row_data_ref->* TO <row>.
          ASSIGN COMPONENT 'ZTGT' OF STRUCTURE <row> TO <col>.
          VAL = <col>.
          IF VAL GT '20'.
            val1 = p_row_index.
            p_style = 'celldesign:CRITICALVALUE_DARK'.
          ENDIF.
        WHEN 4.
            if p_row_index = val1.
              p_style = 'celldesign:CRITICALVALUE_DARK'.
            endif.
        WHEN OTHERS.
    do nothing
      ENDCASE.

    The reason val1 is "loosing its' value" is presumably because you have defined it in the method as a local variable. So each time you call the RENDER_CELL_START method it is is newly initialised. So if you make this an instance attribute it will retain its' contents across method calls.
    Cheers
    Graham Robbo

  • Refreshing sql report region based on values from another region - 4.0

    Greetings All,
    I have a page with two regions, say region 1 and region 2. I have a before header process that fetches values from db based on criteria entered from another page. Region 2 is a sql report region with bind variables from region 1. When this page is rendered region 1 renders properly however sql report region always returns no records. What am i missing here?
    I would like to have the region 2 render a report based on the values from region 1. Region 2 has a sql query that looks something like
    select
    colum 1,
    column 2,
    column 3
    from table t1
    where t1.c1 = :p10_item1
    and t1.c2 = :p10_item2Using apex 4.0
    thanks
    Seetharaman

    If these items hidden, try making them display only .
    Also what happens when you move the items from region 1 to region 2.
    From my experience items do not have much of a dependency on the region they are attached to other than cases when the region is not rendered(when its condition fails) and then the item values become null(bcoz they themselves are not rendered).

  • Insert value into a column based on value of another column

    Hi,
    I am trying to insert a value into a record based on a column in
    the record, using a trigger. The complication arises because
    the new value is selected from the same table. For example:
    SELECT COL1, COL2, COL3, COL4 from TABLE1
    I want to set COL2 and COL3 based on the value of COL4. And to
    get the value of COL2 and COL3, I will go back to TABLE1 and set
    the condition to TABLE1.COL1 = :NEW.COL4
    I cannot seem to execute the trigger as I get the message "ORA-
    04091: table SYSTEM.TABLE1 is mutating, trigger/function may not
    see it" everytime.
    Is this the correct way to achieve what I wanted? Or is there
    another way?
    Appreciate your feedback. Thank you in advance.

    Hi,
    I am trying to insert a value into a record based on a column in
    the record, using a trigger. The complication arises because
    the new value is selected from the same table. For example:
    SELECT COL1, COL2, COL3, COL4 from TABLE1
    I want to set COL2 and COL3 based on the value of COL4. And to
    get the value of COL2 and COL3, I will go back to TABLE1 and set
    the condition to TABLE1.COL1 = :NEW.COL4
    I cannot seem to execute the trigger as I get the message "ORA-
    04091: table SYSTEM.TABLE1 is mutating, trigger/function may not
    see it" everytime.
    Is this the correct way to achieve what I wanted? Or is there
    another way?
    Appreciate your feedback. Thank you in advance. I'm not sure what you mean when you insert a value into a
    record, but if you are setting a value in a column of the same
    record using a trigger, then it's easy.
    :new.COL2 := ....:new.COL4...
    :new.COL3 := ....:new.COL4...
    The trigger must be 'INSERT or UPDATE' and 'FOR EACH RECORD'.
    If you are setting a different record in the same table, the
    solution is much more difficult.

  • Can a subreport select records based on values in the main report record?

    Post Author: calvin
    CA Forum: General
    Perhaps my understanding of a subreport is incorrect as this is the first time I've used one, but it seems to me that the subreport should be able to use the values from the main report record in its (the subreport's) operations-but my subreport doesn't seem to be working that way.In my main report, I select a set of records from a 'request' table. I have a subreport in the detail section so the subreport is processed for each of the request records. That works, but I'm simply getting the same data reported multiple times. It's as if the subreport only uses the last request record rather than the current one. Stating it this way I can see that the problem might be evaluation time-it's processing the request records first, then processing the subreport, and only then printing everything. If this is correct then putting WhilePrintingRecords on the subreport should work-but the only way I know of to do that is in a formula. Can I call the subreport from a formula? Or am I totally off-track?Thanks.

    Post Author: foghat
    CA Forum: General
    Have you established a link(s) between your main report and subreport?When viewing the main report, click edit --> subreport links and link the 2 based on whatever values from the main report you want.

  • Validate a field on selection screen based on value entered on anothr field

    HI,
    There is a program with some fields in selection screen in EWM. The first field is Warehouse. I need to add another field 'Entity to Dispose' in such that what ever value I enter in Warehouse field, its corresponding values should only be displayed as F4 help for 'Entity to Dispose' field.
    For eg: If I select the warehouse as 0799(lets say), then the F4 help for Entity to Dispose field should display only the values which are related to warehouse 0799 (and any other values pertaining to other warehouse should not appear).
    Could anyone suggest, how this can be achieved?
    Thanks in advance.
    Regards,
    Pavan

    Hi,
    You can use FM
    DYNP_VALUES_READ
    DYNP_VALUES_UPDATE
    to read the another field value and Using that field build your internal table for f4 values.
    and use FM F4IF_INT_TABLE_VALUE_REQUEST for F4 values..
    do this on AT SELECTION-SCREEN ON VALUE REQUEST FOR <YOUR_F4_FIELDNAME>.

  • Conditionally set page item based on value of another item

    Hello,
    I have a form that is used to create/apply changes to records. There is an application item (APP_ITEM_PROFILE)
    that is set on login which contains a value for the user's Profile ID. This Profile ID is used through out the
    application for authorizations (conditionally present tabs, etc).
    I've set a page item on the form equal to APP_ITEM_PROFILE so that the record is stamped
    with that user's profile ID when they create a record. Users with different Profile IDs may later make changes to
    the record but I want to keep the original Profile_ID on the record.
    I am trying to populate the Profile ID conditionally in the form based on the existence of a
    record ID. If there is no ID (a new record is being entered), then I want the
    Profile ID to be that of the current user (APP_ITEM_PROFILE). If there is an ID (modification is
    being made to an existing record), then I want the keep the Profile ID that was originally saved
    with the record in MyTable.
    I have this as the source for :P11_PROFILE_ID. The type is PL/SQL Expression or Function, Always, replacing... but it
    is not working (page not found when page is run):
    begin
    if :P11_ID is not null
    then
    select PROFILE_ID
    into :P11_PROFILE_ID
    from MyTable
    where ID = :P11_ID;
    elsif :P11_ID is null
    then select nv(':APP_ITEM_PROFILE') into :P11_PROFILE_ID from dual;
    end if;
    end;
    Item Descriptions:
    ID is the record ID.
    :P11_ID is the page item of the record ID (Display as Text, saves state).
    PROFILE_ID is the user's Profile ID.
    :P11_PROFILE_ID     is the page item of the user's Profile ID.
    :APP_ITEM_PROFILE is the user's Profile ID that is set on login.
    Any help is greatly appreciated.
    Thanks,
    Matt
    Update:
    I found one of Scott's answers:
    Using IF Else to determine the value of a Item
    and modified the above code to:
    declare l_ret number;
    begin
    if :P11_ID is not null
    then
    select PROFILE_ID
    into l_ret
    from MyTable
    where ID = :P11_ID;
    else select :APP_ITEM_PROFILE' into l_ret from dual;
    end if;
    return l_ret;
    end;
    It seems to be setting the Profile ID correctly when the ID is not null, but not when a new record is being created. In the latter case, there is no value.
    Edited by: mterlesky on May 11, 2009 11:02 PM
    Edited by: mterlesky on May 11, 2009 11:52 PM
    Edited by: mterlesky on May 11, 2009 11:53 PM

    Thanks. That is putting the value into the page item and session state but that value is not being saved when the record is created. I'm not sure why - here is part of the debug (the "Billing" table is the "MyTable" table in the previous posting). Any thoughts?
    On form, before submit:
    0.06: Saving g_arg_names=P11_PROFILE_ID and g_arg_values=112
    0.06: ...Session State: Saved Item "P11_PROFILE_ID" New Value="112"
    After Submit
    0.06: ...Session State: Save "P11_PROFILE_ID" - saving same value: "112"
    (validations not shown)
    0.10: Processing point: AFTER_SUBMIT
    0.10: ...Process "Get PK": PLSQL (AFTER_SUBMIT) declare function get_pk return varchar2 is begin for c1 in (select BILLING_SEQ.nextval next_val from dual) loop return c1.next_val; end loop; end; begin :P11_ID := get_pk; end;
    0.10: ...Session State: Save Item "P11_ID" newValue="452" "escape_on_input="Y"
    0.10: ...Do not run process "Get PK for CREATEAGAIN", process point=AFTER_SUBMIT, condition type=, when button pressed=CREATEAGAIN
    0.10: ...Process "Process Row of BILLING": DML_PROCESS_ROW (AFTER_SUBMIT) #OWNER#:BILLING:P11_ID:ID|IUD
    0.10: ...Process "Update TOTAL_HOURS": PLSQL (AFTER_SUBMIT) begin Update billing set TOTAL_HOURS = ((NVL(CD_90801_UNITS,0)*1.5)+ (NVL(CD_90804_UNITS_B,0)*.5)+ NVL(CD_90806_UNITS,0)+ (NVL(CD_90808_UNITS_B,0)*1.5)+ NVL(CD_90812_UNITS,0)+ (NVL(CD_90814_UNITS_B,0)*1.5)+ NVL(CD_90846_UNITS,0)+ NVL(CD_90847_UNITS,0)+ NV
    0.11: ...Process "Update TOTAL_UNITS": PLSQL (AFTER_SUBMIT) begin Update billing set TOTAL_UNITS = (NVL(CD_90801_UNITS,0)+ NVL(CD_90804_UNITS_B,0)+ NVL(CD_90806_UNITS,0)+ NVL(CD_90808_UNITS_B,0)+ NVL(CD_90812_UNITS,0)+ NVL(CD_90814_UNITS_B,0)+ NVL(CD_90846_UNITS,0)+ NVL(CD_90847_UNITS,0)+ NVL(CD_90853_UNITS,0)+ NV
    0.11: ...Process "G_TRANS_COUNT_ADD": PLSQL (AFTER_SUBMIT) begin :G_TRANS_COUNT := :G_TRANS_COUNT +1; end;
    0.11: ...Session State: Saved Item "G_TRANS_COUNT" New Value="1"
    0.11: ...Process "Email_Notification": PLSQL (AFTER_SUBMIT) declare l_body_html varchar2(4000); begin l_body_html := '<p>Billing ID '||:P11_ID||' was entered by '||:P11_PROV_NAME||'.'|| ' More transactions may have been entered by the provider after this one.'||'</p> <p><a
    Edited by: mterlesky on May 12, 2009 9:21 AM

  • Change LOV of column in view, based on values of another LOV of column in the same view

    Hi,
    I am using Jdeveloper 11.1.1.5.
    I have a scenario in which I have two columns in the view. column names are:
    1- Column A
    2- Column B
                        both the columns have LOV's
    LOV in column A contains values as: 1, 2. Now, when I select the value 1 in column A, In the column B, an LOV named ABC should be shown. and when I select value 2 from LOV in column A,  LOV named XYZ should be shown in column B.
    how can I do that?
    thanks in advance (^.^).

    Use onchange attribute of the first drop-down. On change, submit the form. On server side, fetch the values for second drop-down based on the value selected for the first drop-down.

  • Format XML doc based on values in another xml doc

    Database version : Oracle 10g
    I have an XML "data" file and an associated error file that is also XML. I want to take the XML data file and highlight visually in a html file only those fields and contents that are there in the "error" file.
    There are many fields in the data file so the error could be just about anywhere. Can someone please tell me what I should read or give me some direction on how I should proceed?
    I built a style sheet for the "data" file - but obviously that is static. Do i need 2 stylesheets and apply them both somehow? I was also thinking that I would use the "error" xml doc and just rewrite the error nodes in the "data" file and then use the style sheet to mark up the data file based on what i rewrite.
    eg
    if the data is say
    <field1>content of field 1</field1>
    and the error file has field1 in it, I would rewrite the data file to have say <error>content of field 1</error> and just mark up the <error> using the stylesheet. Is that a sensible solution? Even then I need help on the actual xml/sql functions i need to rewrite the xml data.
    I am a rank beginner in this and I apologize - This seems such a newbie question that must have been asked before - I just wish I could find it in the forum.
    Thank you!
    Edited by: user13112667 on Oct 15, 2010 12:38 PM

    Thanks for the samples.
    A couple of options I can think of :
    - XSL transformation (as you first thought of too)
    - XQuery
    Below is a test script that implements both solutions :
    DECLARE
    datadoc xmltype := xmltype(
    '<HII>
    <HII_SEQ_NUM>6084997</HII_SEQ_NUM>
    <HII_RECORD_ID>HII</HII_RECORD_ID>
    <HII_DOC_TYPE>INV</HII_DOC_TYPE>
    <HII_WSLR_ID>XXXXX</HII_WSLR_ID>
    <HII_WSLR_ABBR>COM</HII_WSLR_ABBR>
    <HII_CUST_NBR>096636</HII_CUST_NBR>
    <HII_INV_DATE>100203</HII_INV_DATE>
    <HII_INV_NUMB>829608-1102</HII_INV_NUMB>
    <HII_ORD_NUMB>830412</HII_ORD_NUMB>
    <HII_TP_ID>007839602</HII_TP_ID>
    <HII_WSLR_DUNS>000073669</HII_WSLR_DUNS>
    <HII_TRANS_TYPE>DI</HII_TRANS_TYPE>
    <HII_CAVN_ID>77873</HII_CAVN_ID>
    <HII_VER_NUM>22</HII_VER_NUM>
    </HII>'
    errordoc xmltype := xmltype(
    '<document>
    <error>
    <segment>HII</segment>
    <element>HII_INV_DATE(Inv Date)</element>
    <msg>Invoice date must be in the format yyyymmdd</msg>
    <data>100203</data>
    </error>
    <error>
    <segment>HII</segment>
    <element>HII_TP_ID(TP ID)</element>
    <msg>Data must be 12 digits long</msg>
    <data>007839602</data>
    </error>
    </document>'
    xsldoc xmltype := xmltype(
    '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html" version="4.0"/>
    <xsl:template match="/">
    <HTML>
      <BODY>
       <STYLE type="text/css">
        <![CDATA[
        TR.err { background-color: red }
        TD { border: 1px solid }
        TABLE { border-collapse: collapse }
        ]]>
       </STYLE>
       <TABLE>
       <xsl:apply-templates select="root/datafile/HII/*"/>
       </TABLE>
      </BODY>
    </HTML>
    </xsl:template>
    <xsl:template match="HII/*">
    <xsl:variable name="msg" select="/root/errorfile/document/error[segment=name(current()/..) and substring-before(element,''('')=name(current())]/msg"/>
    <TR>
      <xsl:if test="$msg"><xsl:attribute name="class">err</xsl:attribute></xsl:if>
      <TD><xsl:value-of select="name(.)"/></TD>
      <TD><xsl:value-of select="."/></TD>
      <TD><xsl:value-of select="$msg"/></TD>
    </TR>
    </xsl:template>
    </xsl:stylesheet>'
    html_res1 clob;
    html_res2 clob;
    BEGIN
    -- XSL Transformation
    SELECT XMLTransform(
      xmlelement("root",
       xmlconcat( xmlelement("datafile",datadoc),
                  xmlelement("errorfile",errordoc) )
      xsldoc
    ).getClobVal()
    INTO html_res1
    FROM dual;
    -- XQuery
    SELECT XMLQuery(
      '<HTML>
        <BODY>
         <STYLE type="text/css">
          TR.err {{ background-color: red }}
          TD {{ border: 1px solid }}
          TABLE {{ border-collapse: collapse }}
         </STYLE>
         <TABLE>
          for $i in $d/HII/*
          let $n := name($i)
          let $v := $i/text()
          let $msg := xs:string($e/document/error[segment=name($i/..) and substring-before(element,"(")=$n]/msg)
          return
            element TR {
              if ($msg) then
                attribute class {"err"}
              else (),
              <TD>{$n}</TD>,
              <TD>{$v}</TD>,
              <TD>{ $msg }</TD>
         </TABLE>
        </BODY>
       </HTML>'
      passing datadoc as "d",
              errordoc as "e"
      returning content
    ).getClobVal()
    INTO html_res2
    FROM dual;
    END;
    /Same principle for the two methods : looping through the data document and searching for a matching occurrence in the error document using XPath.
    It produces an HTML document (html_res1 and html_res2) like this :
    <HTML>
    <BODY>
      <STYLE type="text/css">
        TR.err { background-color: red }
        TD { border: 1px solid }
        TABLE { border-collapse: collapse }
        </STYLE>
      <TABLE>
       <TR>
        <TD>HII_SEQ_NUM</TD>
        <TD>6084997</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_RECORD_ID</TD>
        <TD>HII</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_DOC_TYPE</TD>
        <TD>INV</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_WSLR_ID</TD>
        <TD>XXXXX</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_WSLR_ABBR</TD>
        <TD>COM</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_CUST_NBR</TD>
        <TD>096636</TD>
        <TD></TD>
       </TR>
       <TR class="err">
        <TD>HII_INV_DATE</TD>
        <TD>100203</TD>
        <TD>Invoice date must be in the format yyyymmdd</TD>
       </TR>
       <TR>
        <TD>HII_INV_NUMB</TD>
        <TD>829608-1102</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_ORD_NUMB</TD>
        <TD>830412</TD>
        <TD></TD>
       </TR>
       <TR class="err">
        <TD>HII_TP_ID</TD>
        <TD>007839602</TD>
        <TD>Data must be 12 digits long</TD>
       </TR>
       <TR>
        <TD>HII_WSLR_DUNS</TD>
        <TD>000073669</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_TRANS_TYPE</TD>
        <TD>DI</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_CAVN_ID</TD>
        <TD>77873</TD>
        <TD></TD>
       </TR>
       <TR>
        <TD>HII_VER_NUM</TD>
        <TD>22</TD>
        <TD></TD>
       </TR>
      </TABLE>
    </BODY>
    </HTML>Performance-wise, you'll have to test on real documents, but I think XSLT is better.

  • Inserting values in atable based on values in another table

    Hi,
    We receive data from our customers as follows AB784589456. This is the starting value for an serial number of a product. We also receive a quantity. I need to be able to populate rows in another table to start with AB784589456 and then add an additional
    row to the value of the quantity. So the first row in the second table would be AB784589456, the second AB784589457, AB784589458, etc until the number has been incremented to the value of the quantity.
    Order Number     SerialNo
    234                     AB784589456
    234                     AB784589457
    234                     AB784589458
    The datatype of the SerialNo is Varchar(14)
    Any help would be appreciated
    Thanks

    Assuming the serial value format is consistent ie alphabet followed by numeric you can use this
    DECLARE @Serial varchar(14) = 'AB784589456', @Quantity int = 15
    ;With N1
    AS
    SELECT 1 N UNION ALL SELECT 1 UNION ALL SELECT 1
    ),N2
    AS
    SELECT 1 N FROM N1 t1 CROSS JOIN N1 t2
    ),N3
    AS
    SELECT 1 N FROM N2 t1 CROSS JOIN N2 t2 CROSS JOIN N2 t3
    ),N4
    AS
    (SELECT ROW_NUMBER() OVER (ORDER BY (SELECT 1)) AS Seq
    FROM N3
    INSERT INTO YourTable (OrderNumber,SerialNo)
    SELECT OrderNumber,LEFT(@Serial,PATINDEX('%[0-9]%',@Serial)-1) + CAST(STUFF(@Serial,1,PATINDEX('%[0-9]%',@Serial)-1,'') + Seq -1 AS varchar(11))
    FROM Table1 t
    CROSS JOIN N4 n
    WHERE n.Seq BETWEEN 1 AND @Quantity
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to display f4 help for a field based on value of another field

    Hello All,
    I have 4 fields : Sales Org : VBAK-VKORG, Distrib Channel : RV50A-VTWEG, Div : RV50A-SPART, Sold-to-party : KUAGV-KUNNR.
    The second field depends on the first one, the third on the second one and the fourth on the first field.
    However, when each of the second third and fourth fields' f4 help is displayed, the values are independent of the previous fields. How do I set the f4 help to display values based on the respective fields?
    Regards,
    Mithun

    Please be sure that you are searching the forums before posting. This exact same question was asked just yesterday:
    F4 help to input field
    In particular study the section and the linked help document for ddic search helps export/importing parameters and the requirements for DDic Structure/table usage for the parameter mapping.

  • Selecting records based on value of field

    I have a table test with 10,000 records in it and 50 columns.
    I have to select those rows which contain values as "Sales Dum" in their field
    For table with small number of colums i did this
    SELECT * FROM tbl_website_dtl WHERE created_by like '%Sales%'
    or website_name like '%Sales%' or website_code like '%sales%';But should i do for table containing 50 columns.

    Hi,
    Use this procedure,
    CREATE OR REPLACE PACKAGE "GLOBALPKG" AUTHID CURRENT_USER AS
    TYPE RCT1 IS REF CURSOR;
    END GLOBALPKG;
    CREATE OR REPLACE PROCEDURE PL_SEARCH(IN_TABLE_NAME IN VARCHAR2,IN_SEARCH_STRING IN VARCHAR2,RC1 OUT GLOBALPKG.RCT1)
    IS
    V_MESSAGE VARCHAR2(255);
    V_STMT VARCHAR2(2000):='SELECT * FROM '||IN_TABLE_NAME||' WHERE ';
    BEGIN
    FOR R1 IN (SELECT * FROM user_tab_cols WHERE TABLE_NAME=IN_TABLE_NAME AND CHARACTER_SET_NAME='CHAR_CS')
    LOOP
    V_STMT:=V_STMT||' '||R1.COLUMN_NAME||' like ''%'||IN_SEARCH_STRING||'%'' AND ';
    END LOOP;
    V_STMT:=V_STMT||' 1=1';
    OPEN RC1 FOR V_STMT;
    EXCEPTION
    WHEN OTHERS THEN
    V_MESSAGE:=SUBSTR(SQLERRM,1,255);
    OPEN RC1 FOR SELECT V_MESSAGE FROM DUAL;
    END;

Maybe you are looking for

  • CL_GUI_HTML_VIEWER

    hi, I'm using a container and class interface CL_GUI_HTML_VIEWER to display documents (Text, Word...) I just want to display them and don't want the user to be able to change the document. I try to do it with method set_enable form class CL_GUI_HTML_

  • [REQUEST] Wiimidi

    Problem description: After a whole day spent finding how to use my Guitar Hero World Tour Drum Kit (Such a long name...) as a virtual drum pad in my shiny arch, I found the perfect program for me: Wiimidi. It takes all the features that I want. I can

  • Oracle SQL

    Oracle SQL : How do we loop inside a PROMPT and ACCEPT. We have to keep on prompting the user until the user enters the correct values.

  • Help nokia 5800 problem

    help radio for my Nokia 5800 is not working and the whole first page is not working (the two bottoms on the screen. the contact and dailer.)  Solved! Go to Solution.

  • Booking students in the background

    sorry if this is a duplicate...it didn't seem to work the first time. We have a new program that we need to run in the background that will book students into courses.  For all of our booking activity we use the SAP function module HRIQ_STUDENT_BOOKI