compare and replace the value

Hello

Just need a quick help. I have 3 tables. I have some data in Array1 table which has 10 columns.

I take the value in the first column of the array Array1 and compare with the values in table 2. For example, in table 1, is it 133.38 between 30,00 and 230.00 (of arry, 2) then put 50.0 (from table 3) in the last column of the table Array1.

It simply means, take each value of Column1 of array1, control the scope of this value, then exit in the last column of table 3 of the value of the index in table 3 corresponding to the lower bound index in table 2.

Example 2. given 400.00 in array1 table Column1, compare its range with the value of array2. We can see that 400 is between 230 and 1000.00 (of array2), so you have to 70.0 in the last culomn of the array Array1.

Thanks for this help.

Use the threshold D 1 table to get the index where your first value will be compared to table 2, rounded down (towards - Infinity) and index in table 3.  Relplace the corresponding cell in the table 1.

Tags: NI Software

Similar Questions

  • Find and replace the delimited string value by the

    Hi all

    I have a requirement where I need to find and replace the delimited string values.

    For example, the string is "GL ~ 1001 ~ 157747 ~FEB-13~ CREDIT ~ A ~ N ~ US ~ NULL ~". The 4th column gives the month and year. I need to replace it with the name of the previous month. For example: "GL ~ 1001 ~ 157747 ~JAN-13~ CREDIT ~ A ~ N ~ US ~ NULL ~". I need to do the same thing for the past 12 months.

    I thought initially divide the values and store it in a variable and then after him substituting the value required, join the return.

    I just wanted to know if there is a better way to do it?

    Like this:

    with a model like

    (select "GL ~ 1001 ~ 157747 ~ FEB-13 ~ CREDIT ~ A ~ N ~ $ ~ NULL ~' double UNION ALL data")

    Select ' GL ~ 1001 ~ 157747 ~ JAN-13 ~ CREDIT ~ A ~ N ~ US ~ NULL ~' double data)

    Select

    REPLACE (DATA, TO_CHAR (to_date (substr (data, 16.6), "MON-RRRR"), 'MON - RR'), TO_CHAR (to_date (substr (data, 16.6), "MON-RRRR")-1, 'MON - RR'))

    modeling;

    GL ~ 1001 ~ 157747 ~ JAN-13 ~ CREDITS ~ HAS ~ N ~ US ~ NOTHING ~

    GL ~ 1001 ~ 157747 ~ DEC-12 ~ CREDITS ~ HAS ~ N ~ US ~ NOTHING ~

    Ishan

  • replace some symbols and converts the value to a number

    Hi all. I've got bp_link table with 'avalue' column VARCHAR2 (200). If I can find a different version of p here:

    (a) 100%
    (b) 100
    (c) 100.00
    (d) 100.00
    (e) null
    (f) symbol of space
    (I hope that all versions are mentioned).

    So I try to replace some symbols and convert the value to a number using the following steps:

    NVL(Avalue,0) - removes the null value
    Replace (NVL(Avalue,0), '%', ")-removes the symbol '% '.
    Replace (Replace (NVL(Avalue,0), '%', "), ',','. ')-remove a symbol «,»
    Trim (Replace (Replace (NVL(Avalue,0),'%',''),',','.')) - removes the symbol space)))
    TO_CHAR (Trim (Replace (Replace (NVL(Avalue,0), '%', "), ', '.'")), "FM999999999999.90")-converts format "100.00".

    But it still does not, maybe I don't see anything else.

    When I just "select * from...". "it works:

    Select to_char (trim (replace (replace (nvl(avalue,0), '%', "), ', '.'")), "FM999999999999.90")
    as avalue of JJ bp_link where roletypeid = 9

    But when I try "order by avalue" ends with error - ORA-01722: invalid number

    Select to_char (trim (replace (replace (nvl(avalue,0), '%', "), ', '.'")), "FM999999999999.90")
    as avalue of JJ bp_link where roletypeid = 9
    order of dd.avalue

    What can I do else?

    Maybe this will help you
    http://nimishgarg.blogspot.com/2010/04/Oracle-SQL-extract-numbers-from-string.html

  • Need help to compare and replace

    Hi all

    I have a cumulative file that is added at the end of the month. The Table contains information about customers, like:

    customer_id, name, address, phone, notes, DATE_STAMP

    In addition, I have other Tables that are divided into monthly Tables and information for these monthly tables are obtained from this cumulative one table. When I collect the information at the end of the month (which is added to the summary table that grows in size), I put the name of the MONTH in the column DATE_STAMP. MARCH, APRIL, MAY, JUNE, etc...

    So I select all of MARCH (from the cumulative Table) and then who is put in the MARKET Table. These Tables are compared with others a month control Tables for analysis.

    The challenge is what to say in APRIL or MAY, a value important column changes in the summary table so I need to update the monthly tables to reflect this.

    Then... I will concentrate on the key columns.

    customer_id, DATE_STAMP, Sales_Person_Assigned

    In the cumulative table (which has many months), say I select all of MARCH and move customers to a MARCH_TABLE. I'll use a customer as an example:

    customer_id, DATE_STAMP, Sales_Person_Assigned
    12345, MARCH, NULL

    Then in APRIL, most data enters the cumulative file, and those who are stamped APRIL for DATE_STAMP column.

    So, when I check the client who was in MARCH, now in this file, they could be like this: (update of the record sales person)

    customer_id, DATE_STAMP, Sales_Person_Assigned
    12345, MARCH, Frank Smith

    I need a way to take the CUMULATIVE table and compare it with the corresponding MONTH_Table and update that Null for Frank Smith.

    So say what: September today and we have 9 separate Tables Jan - September and ONE cumulative Tables Jan - September, I need only a summary table to check all individual Tables and based on:

    customer_id AND DATE_STAMP - a JOIN match here and if the value is null before in the field of the Sales_Person_assigned, if is no longer null, updated as the new value of cumulative for the monthly tables.

    Any help would be appreciated, sorry if this sounds too complicated.

    user621335 wrote:
    AND (NVL (your. GTP, 'X'). = NVL (tt. GTP, 'Y');

    I know NVL is a function that will replace a value if it is NULL with X or Y. But I wanted to make sure I understand this line. Table your if value is NULL it puts an X (temporarily?) and Y for table tt temporarily?

    So if both are NULL, they will get an X and Y, then they could not equal each other. You can specify that? So that means, if they equal each other, there is no update and to what update? or am I confused?

    Sorry, my mistake - I would have had the same share values and else equal (I've corrected that now).

    If a table your or table tt has a NULL value in a column, no equality will return UNKNOWN, that is, even if we could have a value and the other NULL, it would not be picked up because NULL is the absence of a value and therefore cannot return true or false. NVL will set a value here for the purposes of the motion only, so that either TRUE or FALSE will be returned. Here, the key is that the NVL value must be a value that can never legitimately exist in the column, i.e., 'X' could never be a value in the Sales_Person_Asisgned column. If it's a numeric column, we use-1, or something just as impossible for a legitimate column value.

    If both are NULL, 'X' is equivalent to 'X', so the file will not be updated on this column, if it is NULL, 'X' will not match a legitimate value, so the record will be updated on this column.

  • How to replace the value of a column in a table based on the value in the second column?

    Hi, I would like to find in a table 2D for values that meet certain criteria (for example, a column< 0.98).=""  based="" on="" which="" rows="" meet="" this="" criteria,="" i="" want="" to="" replace="" the="" values="" in="" a="" different="" column="" of="" the="" array="" (change="" to="" 'nan'="" so="" that="" the="" values="" will="" not="" be="" included="" in="" any="" calculations="" on="" that="" column,="" for="" example="" the="" finding="" the="" mean).=""  i've="" attached="" a="" sample="" .csv="" file.=""  if="" the="" values="" in="" column="" 3="" (index="" 2)="" are="" less="" than="" 0.980="" (or="" some="" other="" user="" defined="" value),="" then="" the="" value="" in="" column="" 2="" (index="" 1)="" should="" be="" replaced="" with="" nan.=""  can="" someone="" help="" out="" with="" this="" search="" and="" replace="">

    Thank you

    Keith

    (using LV 2009 SP1)

    A few quick hits.

    You can merge the two for loops

    You have not need one of the constants 1 and 2 in the index table.  They will solve automatically when you expand on the index picture, once you have wired to 0 in the column index.

    It seems a lot of handling additional table spent unnecessarily.

    See below.  I did not try to duplicate your code to see how it actually works, but I believe that I have attached will give the same result with less steps.

  • How can I replace the value of the column with a particular value in SQL

    Hi all

    Is someone can you please tell me how can I format my output with the replacement of a column value with a specific value that really depends on the current value of the column

    I am executing the following SQL statement

    Select state, count (id) from < table_name > where composite_dn = < composite_dn_name > Group by State;
    My current performance is:

    State Instance number
    1 3
    3 28

    I want to replace the value in the State column as follows

    No.OfInstances State
    3 filled
    28 faulted

    I want '1' to be reppaced of 'Done' and '3' is replaced by 'Faulted. '

    Is is possible with SQL or PL/SQL, if it is then how I can achieve this required. Help, please!

    Thanks in advance!

    Published by: Roshni Shankar on October 27, 2012 12:38 AM

    Hi Claude,.

    I guess this CASE clause can be simulated by a DECODE and also it is very easy to use.
    See - http://www.techonthenet.com/oracle/functions/decode.php

    select decode(t1.state,t2.state_id,t2.state_name), t1.count_id
    from  t2, (select state,count(id) count_id
     from 
     where composite_dn= 
    group by state) t1
    where t1.state = t2.state_id;
    

    HTH
    Vanessa B.

    Published by: Vanessa B on October 27, 2012 14:02
    -link added

    Published by: Vanessa B on October 27, 2012 14:19
    -added code sample

  • A Script to find and replace the layer names

    Is there scripts to find and replace the names of layers?

    There is an excellent script available for Photoshop that allows you not only to replace words in layer names, but also insert words as prefixes, Suffixes and sequential numbers.

    The version of the illustrator of this script allows only sequential numbering: it does not offer search and replace words.

    Ideally, it would be great if there were something that could find multiple and replaces in a go:

    (for example

    You have layers like this car, the dog, the bat

    You enter: because (Option1), dog (Option2), Bat (Option3)

    Your layers become then: option 1, option 2, Option3).

    )

    Big_SmiLe, which is a very good start! Step 1 of learning how to Script is indeed, by adjusting an existing simple script to make things more complicated. (And usually then "break something", which is also a necessary part of the process.)

    You are right your comment, it comes to repetitive things. For one or two different articles that wouldn't be a problem, but in the longer lists you are soon lost.

    As usual to work with lists of search - replace is to build a table:

    var layernames = [
    [ 'FHairBowlBoy *Hair', 'Hairboy1' ],
    [ 'FHairCurlyafroBoy *Hair', 'Hairboy2' ],
    [ 'FHairSpikyBoy *Hair', 'Hairboy3' ],
    ];
    

    The general idea is to loop through all the names, check if the current layer name is "layernames [i] [0]" (the left column) and if so, rename it "layernames [i] [1]" (the right column). If you know how to write a loop in Javascript, then you can implement this immediately.

    However...

    A more advanced method to do this didn't need even loop on all layernames - instead you can immediately 'get' the correct name by layer! It's magic! Almost!

    The trick is to use a Javascript object rather than a table. JavaScript objects are nothing special; "Layers" of Illustrator are an array of objects, and each object 'sex' has a 'name' property, which you can read and set the value. What I do here, is to create a new object, where the part 'name' is the name of the original layer and its value is the name of the new layer. All you need to check each layer is if there is a "object.originalLayerName" property and if so, assign its value to this layer name.

    It looks a bit like the table above, except that (1) you use {.} instead of [..] to create an object and (2) you add pairs "name: value" instead of 'value' only (in fact, the 'name' of a value in a table is simply her number).

    So here's what it looks like:

    // JavaScript Document
    var doc = app.activeDocument;
    // name indexed object
    var layernames = {
     'FHairBowlBoy *Hair':'Hairboy1',
     'FHairCurlyafroBoy *Hair':'Hairboy2',
     'FHairSpikyBoy *Hair':'Hairboy3'
    };
    // loop through all layers
    for (var i = 0; i < doc.layers.length; i++)
    {
     //Set up Variable to access layer name
     var currentLayer = app.activeDocument.layers[i];
     if (layernames[currentLayer.name])
     {
      currentLayer.name = layernames[currentLayer.name];
     }
    }
    

    Enjoy!

  • ODI can load data into the planning and REPLACE the existing data?

    Hello
    ODI (9.3.1.1) can load data into the planning and REPLACE the existing data?
    Currently of our ODI by "ADD" load to existing data data - so that is I accidentally run the load twice, it would be double planning numbers. I don't know how to do it to REPLACE so that running more than twice has no effect.

    With the help of the essbase adapter you would use a rule of load, in the State of charge, you can set whether to replace or add to existing values. It is not difficult to pass.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • I have different bookmarks I want to keep on each computer, synchronization will delete the bookmarks on a single computer and replace the bookmarks from another computer in their place

    I have not yet used sync, but I sense it's going to be a problem if I do. I have different bookmarks I want to keep it on each computer. Sync will delete the bookmarks on a single computer and replace the bookmarks from another computer in their place? So I think that will erase the bookmarks on the second computer you configured to synchronize. Is there a way to merge bookmarks on every computer in the library of a bookmark that contains all bookmarks on both computers, so I'm not all bookmarks in sync?

    Just to be clear, this is something that we have commented several times in the forum, Firefox Sync adds everything that is already in the device for the account and pushes this info for the rest of the devices.

    So if you have 2 computers with data X and the other with the data from there, once you set up synchronization in both computers you will have X + Y at the same time.

    I hope that clarifies the doubts...

  • Satellite A30 921: how to remove and replace the memory?

    Hi, can someone help me how to remove and replace the memory of satellite A30 921. and also, please give a detailed instruction.

    Thank you in advance.

    Hello

    There is not much to explain. On the low side in the Middle it is placed to cover memory (fixed with two screws). Remove the cover and you will see 2 slots there. I put t know how much memory you here but like Stefan says you can use max 2 GB of RAM (2 x 1024Mo PC2700 - PA3313U-1M1G). How to remove the memory modules, which you can see on http://www.hardwaresecrets.com/article/189/5

    Good bye

  • Laptop HP Touchsmart 15-D020: how to remove and replace the keyboard on laptop HP Touchsmart 15-D020NR

    I spilt a drink on my keyboard and now I can not turn off the caps lock and a number of keys does not work. I need instructions on how to remove and replace the keyboard frame. Thank you.

    On your page of support-look for Maintenance and Service of Guide in the manuals.

    http://support.HP.com/us-en/product/HP-15-D000-TouchSmart-notebook-PC-series/6627588/model/6761859/manuals

  • How do I click on a cell in a table control and display the value in a string?

    What I want to do is click on a cell in a table control and have the value of the cell in an indicator of the chain. Cell that ever I click on, I wish that the value to be displayed in the indicator.

    Thank you!

    Use the property "Change Position".

  • How to acquire and store the values of DAQmx analog voltage (I do not want the graphic, but strings and values in a chart)?

    Hello

    How acquire and store the values of voltage DAQmx?

    I tried several code example, but they can't get the chart. I don't want to chart. I want to measure exactly the analog voltage values and record these values - as an excel chart, that contains the selected channels and voltage values.

    What the example code that I can use?

    My hardware is NI PCI-6251.

    Thank you very much.


  • Update and change the values when VI is running

    Hello everyone! I have a digital control slider and I want to be able to change and update the value when Vi is running. Can I use the property for this node?

    If it is a CONTROL (no), then it is for the user to set the value via mouse / keyboard.

    You can still set the value via the NŒUD of PROPERTY or the LOCAL VARIABLE for ALL controls.

    What difficulty do you observe?

  • Search and replace the string formatting

    Hello

    I try to do a search and replace the formatting of a string.

    In the example, I'm looking for the string 'SUCCESSFUL', but it must also begin by usbflash and some number + PASSED.

    I can't get the format to have a number between 1 and 99. The number of replacements should add up to 6 in this case. I tried with \d for any number, and I also tried [1-99].

    Make a right-click on the function search and replace the string.  There is an option to use regular Expressions.  Then give it a try.

    EDIT: You need to set the entry replace all to TRUE.

Maybe you are looking for