How to do percent calculations based on a value

Hello,
I'm trying to figure out how to send workflow notifications to only 40% of a selected group..
For example - We have a survey that is sent out once a user completes our Infopath form - right now the survey goes out to 100% of the users..
In the future, we would like the survey to ONLY be sent to 1 in 4 users that complete the form - so 40% of all the users that complete will be sent the survey upon completion..
I know I need to use calculated fields but not sure which formula will work and how to incorporate within our current workflow.
Any suggestions or how-to's would be appreciated since I'm pretty new to workflows.
Thanks
-Andrew

Hi Andrew,
You cannot determine 40% of total people who completed the survey randomly.
If you are using SPD workflow, then this looks tough to do as you have to first find out the total number of Completions (assume 100). (SPDW does not have a way to count the number of items in list. If you can create custom workflow in VS then you can
use SharePoint API with the list ID and get the count:   myList.Items.Count). Then divide that number by 4 (assume 40). If this is decimal then round it up.  Find the names of top 40 or bottom 40 responses. You cannot randomize 40
items from the list.
In my opinion, you need to have fixed algorithm to create workflow out of this. Hope other's can pitch in and provide some inputs.
Regards, Kapil ***Please mark answer as Helpful or Answered after consideration***

Similar Messages

  • How to select different Querys based on Variable Value

    Hi guys i need to know how to select different Querys, based on variable values selected by the user, i try to do it using a Web Template but i don´t know how to program a Dynamic Query.....
    I hope sombody could help me with this
    Message was edited by: Oscar Diaz

    Hi Diaz,
    Can you explain the exact scenario which you are looking for!!!
    regards
    Happy Tony

  • How to capture the entries based on filter values in oo alv..

    Hi all,
    I have a scenario in my oo alv report, when the user select the any column on report and selects the filter option. In that the user can enters required values. Based on filter values the output will be displayed. Now how can i capture currently displaying entries on report.
    Thanks,
    Ashok

    Hi Jozef,
    Is that GET_FILTERED_ENTRIES( ) reads the indexes or values from the entries..?
    Thanks,
    Ashok

  • How to create folder names based on Excel values or Txt files?

    Hi there,
    I often need to create large numbers of folders based on names I have saved in an Excel spreadsheet. I know in windows there is a way to create a macro within excel that automatically generates folder names based on cell values.
    I was therefore wondering how to do the same on a Mac operating system. The main thing is to find a way to automate the process. I understand this may involve copying the values to a text file.
    Below is an example of the names I need to create folders for (copied from the excel spreadsheet):
    Wash Bowl Small 600
    Deck Mounted Wash Bowl 500
    Wash Basin - 866 - 2 Shelves
    Wash Bowl Large 800
    Built-In Wash Basin With 1-Taphole
    Deck Mounted Wash Bowl 625
    Would really appreciate a simple step by step approach to an explanation. As my understanding of using Automator, Apple Script, Terminal, etc, is extremely basic.
    Thanks and Best Wishes,
    Graham

    Hi Niel,
    Thanks again for another superb response. I have another question. Is it possible to automatically generate sub-folders along with the folder.
    For example:
    Folder                                                Subfolder
    Wash Bowl Small 600          >            2D CAD
                                                               3D CAD
                                                               BIM
                                                               Images
                                                               Brochures
                                                               Specifications
                                                               Technical
                                                               Case Studies
                                                               Operations
    Deck Mounted Wash Bowl 500    >   2D CAD
                                                              3D CAD
                                                              BIM
                                                              Images
                                                              Brochures
                                                              Specifications
                                                              Technical
                                                              Case Studies
                                                              Operations
    Above shows the 9 generic sub-folders I need to create within each folder that is generated.
    Best Wishes,
    Graham

  • How to create xml nodes based on a value

    Dear friends,
    I've a question about graphical mapping in SAP PI...
    How can I create XML nodes on the target side based on a value in a XML field on the source side.
    For example:
    This XML field on the source:
    <NO_OF_LINES>4</NO_OF_LINES>
    Must result on 4 Lines on the Target:
    <LINE></LINES>
    <LINE></LINES>
    <LINE></LINES>
    <LINE></LINES>
    So it's actually the opposite of the Count function...
    I appreciate your help,
    Thank you in Advance,
    Kind regards,
    John

    Hi ,
    Try this
    NO_OF_LINES---> count---> UDF---> LINE
    example :
    UDF Code :
    for (int i=0;i<var1[0];i++)
    result.addValue("");

  • How to create a calculation based on several sheets?

    I want to create a sheet that calculates total costs.
    Sheet 1 (Crash Log) contains a list of broken parts.
    Sheet 2 (Parts List) contains a list of available spare parts.
    This table will have Part ID (A), Part Description (B) and Price (C) columns.
    Is there a way to have Numbers populate other cells based on the input of one cell:
    Example:
    In Sheet 1 (Crash Log)
    If I input the Part ID in cell A1, can Numbers insert the Part Description and Price into B1 and C1? The information should come from Sheet 2.
    Is it possible to select an item from a pop-up in Sheet 1 (A1) and have B1 and C1 auto populate?
    Does this make any sence?
    Thank you for any help.
    Mads

    Had some time so threw together a quick sample of what I think Badunit was talking about.
    Quickpost this image to Myspace, Digg, Facebook, and others!

  • Calculations based on the values in the cube

    Hi Guys,
    I need to create a report where I need to calculate a value based on the data available in the cube and not just the data that is the output of the report.
    Is it possible for me to use the data in the table /BIC/<datatarget>00 and perform the calculation using ABAP? If so, how can I display the calculated value on the report and where do I write the code?
    THanks,
    Doniv

    Bhanu,
    But the problem in doing that is, it would still display the age for the corresponding employee in the age column. That should be displayed either.
    All I need is display is the following format
    Department    Averageage
    Dept1           40
    Dept2           50
    Overall         45
    The present format when I set the employee to "No Display" is
    Department    Averageage
    Dept1            40
    ______30
    ______50
    Dept2            50
    ______35
    ______50
    ______65
    overall          45
    *_____ means a blank row
    Thanks,
    Doniv
    Message was edited by: doniv ramuk
    Message was edited by: doniv ramuk

  • How to do running aggr based on prompt value and how to or prompt?

    Hello guys
    I have some requirements that I have a report that has measures and Months and Date..
    1. I have to create dashboard prompts on months and dates in such way that users can select either that want to see monthly sales or daily sales.. So the two prompts should be "or" relationship that point to the same report. If user select month from month prompt, the report will return data at monthly level; if select day on day prompt, it should return data at day level..
    2. Doing running sum based on the dates selected from the prompts.
    If I select day prompt as between "Feb 12th 2009" and "March 1st 2009", the report should return sales data that is the sum of all sales between "Feb 12th 2009" and "March 1st 2009".. If user select month prompt as between "Nov 2008" and "Feb 2009", the report should show the sum of all the sales from "Nov 2008" and "Feb 2009".
    How would I achieve both scenarios?
    Any pointer will be greatly appreciated..

    Hi.
    Maybe you want to have dynamic group by in Answers report by choosing group by part from a dashboard prompt.
    So, assume this example in which you have only one dashboard prompt that shows Day or Month character data.
    Make dashboard prompt:
    edit column formula: 1
    control: drop-down list
    show:
    SELECT case when 1=2 then TIMES.CALENDAR_MONTH_DESC else *'Day'* end FROM "Normal model"
    union all
    SELECT case when 1=2 then TIMES.CALENDAR_MONTH_DESC else *'Month'* end FROM "Normal model"
    default to - specified value: Day
    set variable - presentation variable: pv_dyn_group_by
    label: Group by
    Now make report in Answers and we'll use dynamic column for group by depends on our presentation variable (Day or Month):
    /* column 1 */
    label:
    I don't know how to dynamicly change column label (Month or Day) so I put just label Dynamic group by.
    column formula:
    case when '@{pv_dyn_group_by}' ='Day'
    then EVALUATE('TO_CHAR(%1,%2)' as varchar(20), TIMES.TIME_ID, 'dd.mm.yyyy')
    else TIMES.CALENDAR_MONTH_DESC
    end
    /* column 2 */
    AMOUNT_SOLD
    /* column 3 */
    RSUM(AMOUNT_SOLD)
    Test:
    In both cases we get the same result of RSUM in the end. First we group by a TIMES.TIME_ID if we choose 'Day', second by a TIMES.CALENDAR_MONTH_DESC if we choose 'Month'.
    Is that you want to?
    So if you want to see month or day values to choose it (between part) you must make second prompt with something like this in show SQL results:
    SELECT case when '@{pv_dyn_group_by}{Month}'='Month' then TIMES.CALENDAR_MONTH_DESC end || case when '@{pv_dyn_group_by}{Day}'='Day' then EVALUATE('TO_CHAR(%1,%2)' as varchar(20), TIMES.TIME_ID, 'dd.mm.yyyy') end FROM "Normal model" order by 1
    The name of the second prompt is: '@{pv_filter}{Month}'
    That will display 'Month' or 'Day'. I don't know better solution :-)
    Similar is to make a between 2 prompts.
    After then you must modify filter in Answers to get OR (between dates ot between months)
    Regards,
    Goran Ocko
    http://108obiee.blogspot.com/

  • Acrobat Pro 9: Calculating Based on Checkbox Value

    Hi!
    I am a novice and I purchased Adobe Acrobat Pro 9. Can
    someone help me figure out how to do calculations of checkboxes? I
    am trying to do the following:
    I want to create 2 columns of 10 check boxes each. I want to
    keep a running total of how many are checked in Column 1 and a
    running total of how many are checked TOTAL (in both columns). Now,
    the document has 3 pages, and on each pages - there are 2 columns
    of 10 check boxes. I want the running total to include all boxes
    from the 3 pages.
    I hired a freelancer who did this in LiveCycle (using Acrobat
    Pro 8). It worked on her blank page, but when we copied and pasted
    the check boxes into my document (a pre-made PDF exam I have to use
    for work; my school would not allow me to give it to her to work
    with); the calculations wouldn't work. We went into LiveCycle and
    each time we opened up my document with her calculations, the
    language changed automatically from FormCalc to JavaScript.
    Can anyone give me advice or tell me what to do? (We do have
    two read only boxes that do calulations [total checked in Column 1
    and total checked] so it really should work...)
    Thank you for considering and taking the time out to help!
    Alisa

    Hello,
    I'm sorry I'm not able to address your question. These forums
    are specific to the
    Acrobat.com website and its set of hosted services, and do
    not cover the Acrobat family of desktop products.
    Any questions related to the Acrobat family of desktop
    products would be best suited in the Acrobat User Forums:
    Link to
    Acrobat Forums
    Thanks!
    Michelle

  • Stoplight Format: How to show percent sign next to each value?

    I need to show a percent sign next to each data value on a column that has a stoplight format. The calculation has been created and works perfectly. But when I add the stoplight format, the percent sign '%' disappears. For example, acolumn data value is 95.25%. After I add the stoplight formula, 95.25% becomes 95.25.

    Thanks for your help, nearly worked but only returned results where the if statement was met ie where locked =0, so I used an additional statement to display something else when when locked=1
    <?php
    if($row_spec_rx['locked'] == 1) {
    echo "button html goes here";
    ?>
    <?php
    if($row_spec_rx['locked'] == 0) {
    echo "something else";
    ?>
    I am sure there must be a more elegant way of doing this!

  • How to initiate a trigger based on threshold value from DAQ

    Hello,
             can anyone please tell me how to start a counter/trigger based upon a threshold value/??i would like to measure the amount of time
    the particular input value is greater than the threshold value...
    I tried out the simple VI attached, but the start time and the end time show the same values... can anyone please suggest/???
    Now on LabVIEW 10.0 on Win7
    Attachments:
    trigger.vi ‏103 KB

    sorry, attached the wrong VI,
    here you go,,, this should work....
    Now on LabVIEW 10.0 on Win7
    Attachments:
    Trigger Counter.vi ‏143 KB

  • How to create a list based on a value in multiple sheets

    I am trying to create a list in numbers that references a common value among multiple sheets.  I have 4 sheets created for a fantasy football league (1 sheet for QB, 1 for Running Back, 1 for Wide Receiver and 1 for Tight End).  I have assigned a value to each player listed on each individual sheet.  I would like to create a 5th sheet that lists the players in order from highest to lowest value as they are marked on their position sheet.  How would this be done in Numbers?
    Thanks for the help!

    Here is one possible solution:
    I named the four data tables "QB", "RB", "TE", and "WR", and the 5th table, for lack of a better name "Summary".
    NOTE:  The first row OF EVERY TABLE is a header.
    In the summary table:
    A2=OFFSET(INDIRECT(A$1&" :: $A$1"), MATCH(LARGE(INDIRECT(A$1&" :: B"), ROW()-1), INDIRECT(A$1&" :: B"))-1, 0, 1, 1)
    select A2 and fill to the right, then select A2 thru D2 and fill down as needed

  • How to show/hide div based on mysql value

    I have a dataset that has a column 'locked' that is a boolean that I want to use to remove a button on a form.  The idea being that it will be set to 1 after a period of time thus removing the buttun that links to an update form and preventing the data from being changed.  Currently, I have the field linked to a check box at the top of the table.  How do I use this to hide the button (or any other html element for that matter) when set to 1 and show the element when set to 0?  I understand I need to creat a php variable from the mysql boolean and then use a if/else loop to hide/display the html but I don't know how to impliment this?  Thanks for any help offered.
    Here's the code:
    <?php require_once('Connections/testmypms.php'); ?>
    <?php
    $currentPage = $_SERVER["PHP_SELF"];
    $maxRows_spec_rx = 10;
    $pageNum_spec_rx = 0;
    if (isset($_GET['pageNum_spec_rx'])) {
      $pageNum_spec_rx = $_GET['pageNum_spec_rx'];
    $startRow_spec_rx = $pageNum_spec_rx * $maxRows_spec_rx;
    $colname_spec_rx = "1";
    if (isset($_GET['pxID'])) {
      $colname_spec_rx = (get_magic_quotes_gpc()) ? $_GET['pxID'] : addslashes($_GET['pxID']);
    mysql_select_db($database_testmypms, $testmypms);
    $query_spec_rx = sprintf("SELECT spec_rx.spec_rx_id, spec_rx.FK_px_id, DATE_FORMAT(spec_rx.spec_rx_date, '%%d-%%m-%%Y') as formatted_rx_date, spec_rx.FK_user_id, spec_rx.spec_rx_rsph, spec_rx.spec_rx_rcyl, spec_rx.spec_rx_raxis, spec_rx.spec_rx_rhprism, spec_rx.spec_rx_rhprismbase, spec_rx.spec_rx_rvprism, spec_rx.spec_rx_rvprismbase, spec_rx.spec_rx_rnadd, spec_rx.spec_rx_rnhprism, spec_rx.spec_rx_rnhprismbase, spec_rx.spec_rx_rnvprism, spec_rx.spec_rx_rnvprismbase, spec_rx.spec_rx_rintadd, spec_rx.spec_rx_rinthprism, spec_rx.spec_rx_rinthprismbase, spec_rx.spec_rx_rintvprism, spec_rx.spec_rx_rintvprismbase, spec_rx.spec_rx_lsph, spec_rx.spec_rx_lcyl, spec_rx.spec_rx_laxis, spec_rx.spec_rx_lhprism, spec_rx.spec_rx_lhprismbase, spec_rx.spec_rx_lvprism, spec_rx.spec_rx_lvprismbase, spec_rx.spec_rx_lintadd, spec_rx.spec_rx_linthprism, spec_rx.spec_rx_linthprismbase, spec_rx.spec_rx_lintvprism, spec_rx.spec_rx_lintvprismbase, spec_rx.spec_rx_lnadd, spec_rx.spec_rx_lnhprism, spec_rx.spec_rx_lnhprismbase, spec_rx.spec_rx_lnvprism, spec_rx.spec_rx_lnvprismbase, spec_rx.locked, users.user_id, users.user_firstname, users.user_surname FROM spec_rx, users WHERE %s = spec_rx.FK_px_id AND spec_rx.FK_user_id = users.user_id ORDER BY spec_rx.spec_rx_date DESC, spec_rx.spec_rx_id DESC", $colname_spec_rx);
    $query_limit_spec_rx = sprintf("%s LIMIT %d, %d", $query_spec_rx, $startRow_spec_rx, $maxRows_spec_rx);
    $spec_rx = mysql_query($query_limit_spec_rx, $testmypms) or die(mysql_error());
    $row_spec_rx = mysql_fetch_assoc($spec_rx);
    if (isset($_GET['totalRows_spec_rx'])) {
      $totalRows_spec_rx = $_GET['totalRows_spec_rx'];
    } else {
      $all_spec_rx = mysql_query($query_spec_rx);
      $totalRows_spec_rx = mysql_num_rows($all_spec_rx);
    $totalPages_spec_rx = ceil($totalRows_spec_rx/$maxRows_spec_rx)-1;
    $colname_demographics = "1";
    if (isset($_GET['pxID'])) {
      $colname_demographics = (get_magic_quotes_gpc()) ? $_GET['pxID'] : addslashes($_GET['pxID']);
    mysql_select_db($database_testmypms, $testmypms);
    $query_demographics = sprintf("SELECT demographics.px_id, demographics.FK_title_id, demographics.firstname, demographics.surname, DATE_FORMAT(demographics.dob, '%%d-%%m-%%Y') as formatted_dob, title.title_id, title.title FROM demographics, title WHERE %s = demographics.px_id AND demographics.FK_title_id = title.title_id", $colname_demographics);
    $demographics = mysql_query($query_demographics, $testmypms) or die(mysql_error());
    $row_demographics = mysql_fetch_assoc($demographics);
    $totalRows_demographics = mysql_num_rows($demographics);
    $queryString_spec_rx = "";
    if (!empty($_SERVER['QUERY_STRING'])) {
      $params = explode("&", $_SERVER['QUERY_STRING']);
      $newParams = array();
      foreach ($params as $param) {
        if (stristr($param, "pageNum_spec_rx") == false &&
            stristr($param, "totalRows_spec_rx") == false) {
          array_push($newParams, $param);
      if (count($newParams) != 0) {
        $queryString_spec_rx = "&" . htmlentities(implode("&", $newParams));
    $queryString_spec_rx = sprintf("&totalRows_spec_rx=%d%s", $totalRows_spec_rx, $queryString_spec_rx);
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Spec Rx3</title>
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_goToURL() { //v3.0
      var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
      for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
    //-->
    </script>
    </head>
    <body>
    <p>Spec Rx</p>
    <p><?php echo $row_demographics['px_id']; ?></p>
    <p><?php echo $row_demographics['title']; ?> <?php echo $row_demographics['firstname']; ?> <?php echo $row_demographics['surname']; ?> <?php echo $row_demographics['formatted_dob']; ?> </p>
    <p>
      <input name="Add_spec_rx" type="button" id="Add_spec_rx" onClick="MM_goToURL('parent','add_spec_rx.php');return document.MM_returnValue" value="New Rx">
    </p>
    <p> <a href="<?php printf("%s?pageNum_spec_rx=%d%s", $currentPage, max(0, $pageNum_spec_rx - 1), $queryString_spec_rx); ?>">Previous</a> <a href="<?php printf("%s?pageNum_spec_rx=%d%s", $currentPage, min($totalPages_spec_rx, $pageNum_spec_rx + 1), $queryString_spec_rx); ?>">Next</a></p>
    <?php do { ?>
    <table border="1" cellspacing="1" cellpadding="5">
      <tr>
        <td> </td>
        <td><?php echo $row_spec_rx['formatted_rx_date']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_id']; ?></td>
        <td>locked:
        <input <?php if (!(strcmp($row_spec_rx['locked'],1))) {echo "checked";} ?> name="locked" type="checkbox" id="locked" value="1"></td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
      <tr>
        <td> </td>
        <td>Sph</td>
        <td>Cyl</td>
        <td>Axis</td>
        <td>HPrism</td>
        <td>HPrismBase</td>
        <td>VPrism</td>
        <td>VPrismBase</td>
        <td>NrAdd</td>
        <td>NrHPrism </td>
        <td>NrHPrismBase</td>
        <td>NrVPrism</td>
        <td>NrVPrismBase</td>
        <td>IntAdd</td>
        <td>IntHPrism</td>
        <td>IntHPrismBase</td>
        <td>IntVPrism</td>
        <td>IntVPrismBase</td>
      </tr>
      <tr>
        <td>R</td>
        <td><?php echo ($row_spec_rx['spec_rx_rsph']<>null) ? sprintf ("%+4.2f",$row_spec_rx['spec_rx_rsph']) : null; ?></td>
        <td><?php echo ($row_spec_rx['spec_rx_rcyl']<>null) ? sprintf ("%+4.2f",$row_spec_rx['spec_rx_rcyl']) : null; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_raxis']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_rhprism']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_rhprismbase']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_rvprism']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_rvprismbase']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_rnadd']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_rnhprism']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_rnhprismbase']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_rnvprism']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_rnvprismbase']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_rintadd']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_rinthprism']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_rinthprismbase']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_rintvprism']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_rintvprismbase']; ?></td>
      </tr>
      <tr>
        <td>L</td>
        <td><?php echo ($row_spec_rx['spec_rx_lsph']<>null) ? sprintf ("%+4.2f",$row_spec_rx['spec_rx_lsph']) : null; ?></td>
        <td><?php echo ($row_spec_rx['spec_rx_lcyl']<>null) ? sprintf ("%+4.2f",$row_spec_rx['spec_rx_lcyl']) : null; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_laxis']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_lhprism']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_lhprismbase']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_lvprism']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_lvprismbase']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_lnadd']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_lnhprism']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_lnhprismbase']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_lnvprism']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_lnvprismbase']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_lintadd']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_linthprism']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_linthprismbase']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_lintvprism']; ?></td>
        <td><?php echo $row_spec_rx['spec_rx_lintvprismbase']; ?></td>
      </tr>
      <tr>
        <td> </td>
        <td>User ID <?php echo $row_spec_rx['user_id']; ?></td>
        <td><?php echo $row_spec_rx['user_firstname']; ?></td>
        <td><?php echo $row_spec_rx['user_surname']; ?></td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
        <td> </td>
      </tr>
    </table>
    <p> </p>
    <?php } while ($row_spec_rx = mysql_fetch_assoc($spec_rx)); ?>
    <p> </p>
    <p> </p>
    <p> </p>
    </body>
    </html>
    <?php
    mysql_free_result($spec_rx);
    mysql_free_result($demographics);
    ?>

    Thanks for your help, nearly worked but only returned results where the if statement was met ie where locked =0, so I used an additional statement to display something else when when locked=1
    <?php
    if($row_spec_rx['locked'] == 1) {
    echo "button html goes here";
    ?>
    <?php
    if($row_spec_rx['locked'] == 0) {
    echo "something else";
    ?>
    I am sure there must be a more elegant way of doing this!

  • UpdateXML : How to update EmployeeName tag based on EmployeeID value

    Hi All,
    My XMLType (EMP_DOCUMENT) field in a table stores the following simple XML structure:
    <DEPARTMENT>
         <DEPARTMENT_ID>1</DEPARTMENT_ID>
         <DEPARTMENT_NAME>Finance</DEPARTMENT_NAME>
         <EMPLOYEE>
              <EMPLOYEE_ID>1</EMPLOYEE_ID>
              <FIRST_NAME>ABC</FIRST_NAME>
              <EMAIL>ABC</EMAIL>
    </EMPLOYEE>
         <EMPLOYEE>
              <EMPLOYEE_ID>2</EMPLOYEE_ID>
              <FIRST_NAME>xyz</FIRST_NAME>
              <EMAIL>xyz</EMAIL>
    </EMPLOYEE>
         <EMPLOYEE>
              <EMPLOYEE_ID>3</EMPLOYEE_ID>
              <FIRST_NAME>zzzz</FIRST_NAME>
              <EMAIL>zzz</EMAIL>
    </EMPLOYEE>
         <EMPLOYEE>
              <EMPLOYEE_ID>4</EMPLOYEE_ID>
              <FIRST_NAME>yyyy</FIRST_NAME>
              <EMAIL>yyyy</EMAIL>
    </EMPLOYEE>
    </DEPARTMENT>
    Employee_ID is unique and Employee_Name is not unique.
    I have a requirement to update the Employee_Name tag where i have the Employee_ID and the value to be updated.I tried the following but it updates all Employee_Names instead of updating the record i want:
    UPDATE EMPLOYEE_DOCUMENTS p
    SET p.EMP_DOCUMENT = updateXML(p.EMP_DOCUMENT,
                   '/DEPARTMENT/EMPLOYEE/FIRST_NAME/text()',
              'Scott')
    WHERE DOCUMENT_ID = 1
    AND existsNode(p.EMP_DOCUMENT,'/DEPARTMENT/EMPLOYEE[EMPLOYEE_ID = 2')=1
    I can see that updateXML essentially acts as 'ReplaceXML' where one tag can be searched and replaced with the new value.But is it possible to UPDATE a tag based on other tag at the same level (like update the employee_name based on employee_id)
    Thanks,
    Srihari
    Edited by: srihari manian on Jul 15, 2009 7:19 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I believe this is what you are looking for
    WITH employee_documents AS
    (SELECT XMLTYPE('<DEPARTMENT>
    <DEPARTMENT_ID>1</DEPARTMENT_ID>
    <DEPARTMENT_NAME>Finance</DEPARTMENT_NAME>
    <EMPLOYEE>
    <EMPLOYEE_ID>1</EMPLOYEE_ID>
    <FIRST_NAME>ABC</FIRST_NAME>
    <EMAIL>ABC</EMAIL>
    </EMPLOYEE>
    <EMPLOYEE>
    <EMPLOYEE_ID>2</EMPLOYEE_ID>
    <FIRST_NAME>xyz</FIRST_NAME>
    <EMAIL>xyz</EMAIL>
    </EMPLOYEE>
    <EMPLOYEE>
    <EMPLOYEE_ID>3</EMPLOYEE_ID>
    <FIRST_NAME>zzzz</FIRST_NAME>
    <EMAIL>zzz</EMAIL>
    </EMPLOYEE>
    <EMPLOYEE>
    <EMPLOYEE_ID>4</EMPLOYEE_ID>
    <FIRST_NAME>yyyy</FIRST_NAME>
    <EMAIL>yyyy</EMAIL>
    </EMPLOYEE>
    </DEPARTMENT>') emp_document
      FROM DUAL
    SELECT updateXML(p.EMP_DOCUMENT,
    '/DEPARTMENT/EMPLOYEE[EMPLOYEE_ID = 2]/FIRST_NAME/text()',
    'Scott')
      FROM employee_documents pwhich just updates the name for employee id 2.

  • How to hide a field based on the value of a field in a different subform - null check doesn't work!

    I'm using Javascript to set the actions. I need to hide a text field if the value of a field in another sub-form is null.
    - tried checking the value of the other field for null - doesn't work
    - tried setting a variable str2 where I know the value of the other field is available then checking that variable when I initialize the text field - doesn't work
    What am I missing?

    Hi.
    Try this in the originating sub form referring to the text field (X). 
    if (this.rawValue = 1)
              X.presence = "visible";
    else if (this.rawValue = null)
              X.presence = "hidden";

Maybe you are looking for