Required UDF for comparing values within same context

I have to compare values within the same context.I am getting boolean values for that field.If all the values in the same context are true,then the result should be true .Otherwise false  should be passed.
If input is-
<context>                                  
true
false
true
<context>
true
true
<context>
Output should be as-
<context>
false
<context>
true
<context>
Please suggest how to acheive this?..its urgent

Hi,
Check with this UDF
Src>UDF>target
public void context1(String[] a,ResultList result,Container container)
    int k = 0;
    int arrayLength = a.length;
    if (arrayLength > 0)
        String firstElement = a[0];
        for (int i = 1; i < arrayLength; ++i)
               if(!(a<i>.equalsIgnoreCase(firstElement)))
                 k = 0;
                 break;
               else
                 k = 1;
if(k == 1)
    result.addValue("true");
else
    result.addValue("false");

Similar Messages

  • And condition for a value within same column

    Hi,
    I would like to select the rows from table which matches key='DKJ' and key='BK5'
    Is it possible to use exists condition here...to get the result only when it contains both the keys. Please could you suggest me alternative query for the below..
    SELECT a.or_no,b.key
    FROM v_sp a,
    v_off b
    WHERE a.or_no = '27422739'
    AND a.key_code = b.key_code
    AND(b.mod = '00K'
    AND(b.key = 'DKJ' OR b.keystroke = 'BK5'))
    Many Thanks,
    Hari

    Hi,
    I would like to select the rows from table which
    matches key='DKJ' and key='BK5'
    Is it possible to use exists condition here...to get
    the result only when it contains both the keys.
    Please could you suggest me alternative query for the
    below..
    SELECT a.or_no,b.key
    FROM v_sp a,
    v_off b
    a.or_no = '27422739'
    AND a.key_code = b.key_code
    AND(b.mod = '00K'
    AND(b.key = 'DKJ' OR b.keystroke = 'BK5'))
    What you say and what you do aren't the same. Please clarify.

  • ***UDF for Splitby Value

    Hi all,
    My requirements is not to use Split by value.I require a UDF code for the same.
    Thanks,
    Srinivasa

    Use UDF of type "all values from a context" with one parameter var1
    Here is the code:
    for (int k = 0; k< var1.length; k++){
      result.addValue(var1[k]);
      if (k < var1.length -1)
        result.addContextChange();
    If you want to use it in a function of type "all values of the queue" it is more complex.

  • Reg: UDF for removing values after decimals

    HI,
      Please help me on the below issue,
      I need an UDF for the follwing requirement,
    as my input value is 12354.12354875 then the result will be like 12345.123,
    After deceimal it should get only 3 values.
    Please help me points will be awarded.
    Edited by: UDAY on Apr 5, 2010 3:56 PM

    >
    UDAY wrote:
    > yes its needed to be truncated only not rounded.
    In that case even the standard function FormatNum can also help.
    Regards,
    Abhishek.

  • Case structure for comparing values

    Hi,
    i just wanted to know if there is a special way to use comparison in case structures.
    I only kow how to create cases for things like if x=0 then ... if x=1 then ...
    Now I want to make it if x<0 then ... if x=0 then ... if x>0 then ...
    The only solution I found so far is creating a case structure inside a case structure.
    Is there a way to keep it all in just one case structure?
    Thanks and have a nice weekend,
    Bernie

    Case Structures are pretty flexible in how you can specify what triggers a particular case. You can specify ranges or various values per case.
    In your situation, if you specify three cases with the following values, you'll get what you want.
    '..-1' = x<0
    '0' = 0
    '1..' = x>0
    The two periods before or after a number indicate that the case should run if the value is anything less than or greater than the specified number, depending on which side of the number you place it. You can also use this to specify a range of number. '1..10' would trigger the case for any value 1 through 10. Using a comma between numbers lets you specify different non-sequencial numbers. '1,5,10' would run the case only those specified numbers.
    The same basic rules a
    lso work with text based Case Structures.
    Attached image shows the three cases you need.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    Case_Range_Values.gif ‏21 KB

  • How to search for a value within a tolerance in an array?

    I am trying to search in an array for a value of say 10 plus or minus 2. In other words, I want a value of true if there is any value in the array between 8 and 12.

    canadian;
    LabVIEW includes with a VI called In Range and Coerce. You can test the value using that VI.
    I also created a VI for exactly that. You can download it from here:
    http://www.jyestudio.com/lview.shtml
    It is called Search 1D array using conditions. Let me know if it is useful. Even more efficient, you can look at the code of that VI and then extract the functionality you want for your application.
    Regards;
    Enrique
    www.vartortech.com

  • Comparing column values within same row

    Script
    <code>
    create table testp
    ( name varchar2(20),
    yr1 number,
    yr2 number,
    yr3 number,
    yr4 number);
    insert into testp values ('Jana',500,400,300,900);
    insert into testp values ('sarat',200,300,800,100);
    commit;
    <code>
    I need the result like this
    <code>
    NAME    First_greatest    Second_greatest
    Jana       900                   500
    sarat       800                   300
    <code>
    I've used greatest function to get the First_greatest result, but not getting the second_greatest, can you help?
    Thanks

    Hi,
    Here's one way to do that:
    WITH got_r_num AS
        SELECT   name
        ,        n
        ,        ROW_NUMBER () OVER ( PARTITION BY  name
                                      ORDER BY      n DESC
                                    )   AS r_num
        FROM     testp
        UNPIVOT   (    n
                  FOR  yr  IN ( yr1
                              , yr2
                              , yr3
                              , yr4
    SELECT    *
    FROM      got_r_num
    PIVOT     (    MAX (n)
              FOR  r_num  IN ( 1 AS first_greatest
                             , 2 AS second_greatest
    Output:
    NAME                 FIRST_GREATEST SECOND_GREATEST
    Jana                            900             500
    sarat                           800             300
    Perhaps your data should be stored in an upivoted form in the first place, with each yr on a separate row.

  • Required setting for Locale values for Arabic db in oracle 10g

    I want to create a new db in Oracle 10g for storing the arabic data.
    My client machine is Arabic Windows XP.
    What are the steps that i will need to follow to make the db arabic supported.
    What streps will be required if i choose to make it unicode supported?
    Setting the following:-
    1. Set Database Character Set to AL32UTF8 for the Oracle Server.
    2. Set the NLS_LANG to ARABIC_LIBYA.UTF8 (on Arabic Windows xp)
    Will do the work?

    The database character set should be AL32UTF8 for Unicode support. This is a recommended setting.
    As far as NLS_LANG is concerned, this strongly depends on how your client application is written (what technology, which Oracle access API). For example, for SQL*Plus, the NLS_LANG must be set to AR8MSWIN1256, as SQL*Plus does not support Unicode on Windows, only the ANSI code page. For SQL Developer, the NLS_LANG does not matter at all.
    -- Sergiusz

  • SQL query for updating values in same cell of a table

    Hi All,
    I'm stuck with a problem and it stands as follows:
    Table name: Track
    Part1  Part2  Part3
    NULL   NULL   NULL
    I've a table called Track, which has three columns named Part1, Part2 and Part3. I want all values of Part1 to be separated by a comma (,); it should not be overwritten, neither they should appear in separate row, in fact they should look like this:
    Part1    Part2    Part3
    1,2,3    5          SUBM1
    The new values of Part1 should appear in next row only when value of Part3 changes, so if Part3 changes from SUBM1 to SUBM2, it should look like this:
    Part1    Part2    Part3
    1,2,3    5          SUBM1
    1,2,3    5          SUBM2
    Count of values in Part1 never exceeds the value of Part2, so if Part2 is 5, then Part1 will look like 1,2,3,4,5. So in other words loop will run only up to the value of Part2.
    Please advise how this could be achieved?
    Kind regards,
    Aniruddha Jagdale

    I've a table called Track, which has three columns named Part1, Part2 and Part3. I want all values of Part1 to be separated by a comma (,);
    No, don't go there.
    This breaks a fundamental point for relational databases: no repeating groups. A cell should hold an atomic value. And this is not only a matter of purism. Relational databases are designed from this principle, and breaking this means that you will need
    to write complex and higly inefficient code.
    The values in Part1 should be in a separate table, with one value per row.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • UDF for Checking the field value

    Hi
    I want to check the whether the fiels conatins any value or not in mapping ... if not i want to raise the exception using the UDF
    DO any one have sample code for writing the UDF
    SV

    Hi SV
    what is your requirement first that should br clear.
    i am giving you two UDF
    1) i have written this uDF for string and comparing the field value XYZ
    2) i am entering a string and its returning aa string which starts from the index of your input fixed length
    int len = a.length();
    String res = "";
    String temp = "";
    if ( len >= 10)
    temp = a.substring(0,10);
    if ( temp.equals("XYZ"))
    res = temp;
    else
    res = "";
    return res;
    =======================================
    String fixed = "ABCD";
    String res = "";
    int index = -1;
    index = a.indexOf(fixed);
    if (index == -1)
    res = "NO INDEX FOUND";// or if u wanna set it as null res = "";
    else
    res = b.substring(index4,index12);
    return res;
    ===
    hope these may solve your problem
    Thanks
    Sandeep sharma
    If helpful reward points

  • Dynamic value binding for InputTextField - Expression within an expression

    Hi,
    I have this requirement where I have to use an EL expression's output as a bean's property in the value attribute of a InputTextField. E.g.
              <h:dataTable value="#{entity.formats}" var="field">
                   <h:column>
                        <h:outputLabel value="#{field.shortDesr}"/>
                   </h:column>
                   <h:column>
                        <h:inputText value="#{*entity."+#{field.shortDesr}+*"}"/>     
                   </h:column>     
              </h:dataTable>
    The JSF page will be a generic one so the fields within a form will be dynamic and will be formed at run-time. Since the exact bean property(entity in the code above) for a particular field is not known before, it needs to be dynamicaly built
    To give more clarity. In the following snippet, i know that entity is the bean to be used but which property(XXX) the text field has to be bound is not known and needs to be assigned at run-time.
    <h:inputText value="#{entity.*XXX*"/>     
    Is this possible? Are there any direct JSF solution or work arounds for it? Appreciate your inputs.
    Thanks
    Ranjith

A: Dynamic value binding for InputTextField - Expression within an expression

Hi BaluSC,
Your solution is totally acceptable. But I was also looking for something that can make possible direct binding to the bean properties without going through a Map.
In the meantime, I worked around the problem by not using the DataTable. Instead I loop the collection and add the Form elements programatically (code given below). With this I am able to achieve the desired effect of binding directly to the bean's property. But I am hitting another problem now, On submit the form Seam throws up 'No active conversational context" error while binding the #{sdmManager.grid} attribute. Now, I am trying to figure out how to come across it.
JSF
     <h:panelGrid columns="2" binding="#{sdmManager.grid}">
</h:panelGrid>
Bean code
     public HtmlPanelGrid getGrid(){
     grid = new HtmlPanelGrid();
     List<UIComponent> children = grid.getChildren();
     Collection<FieldFormatData> formats = dataManager.getFieldFormatData();
     for(FieldFormatData format:formats){
          HtmlOutputLabel outputLabel = new HtmlOutputLabel();
          outputLabel.setValue(format.getShortDesr());
          children.add(outputLabel);
          HtmlInputText inputText = new HtmlInputText();
          inputText.setSize(10);
          inputText.setMaxlength(10);
          System.out.println("Binding ................................... " + format.getEntityField());
          inputText.setValueBinding("value", FacesContext.getCurrentInstance().getApplication().createValueBinding("#{entity."+format.getEntityField()+"}"));
          children.add(inputText);
     return grid;

Hi BaluSC,
Your solution is totally acceptable. But I was also looking for something that can make possible direct binding to the bean properties without going through a Map.
In the meantime, I worked around the problem by not using the DataTable. Instead I loop the collection and add the Form elements programatically (code given below). With this I am able to achieve the desired effect of binding directly to the bean's property. But I am hitting another problem now, On submit the form Seam throws up 'No active conversational context" error while binding the #{sdmManager.grid} attribute. Now, I am trying to figure out how to come across it.
JSF
     <h:panelGrid columns="2" binding="#{sdmManager.grid}">
</h:panelGrid>
Bean code
     public HtmlPanelGrid getGrid(){
     grid = new HtmlPanelGrid();
     List<UIComponent> children = grid.getChildren();
     Collection<FieldFormatData> formats = dataManager.getFieldFormatData();
     for(FieldFormatData format:formats){
          HtmlOutputLabel outputLabel = new HtmlOutputLabel();
          outputLabel.setValue(format.getShortDesr());
          children.add(outputLabel);
          HtmlInputText inputText = new HtmlInputText();
          inputText.setSize(10);
          inputText.setMaxlength(10);
          System.out.println("Binding ................................... " + format.getEntityField());
          inputText.setValueBinding("value", FacesContext.getCurrentInstance().getApplication().createValueBinding("#{entity."+format.getEntityField()+"}"));
          children.add(inputText);
     return grid;

  • The value in flexfield context reference web bean does not match with the value in the context of the Descriptive flexfield web bean BranchDescFlex. If this in not intended, please go back to correct the data or contact your Systems Administrator for assi

    Hi ,
    We have enabled context sensitive DFF in Bank Branch Page for HZ_PARTIES DFF , We have created Flex Map so that only bank branch context fields are only displayed in the bank branch page and  as we know party information DFF is shared by supplier and Customer Page so we dint want to see any Bank Branch fields or context information in those pages.
    We have achieved the requirement but when open existing branches bank branch update is throwing below error message :
    "The value in flexfield context reference web bean does not match with the value in the context of the Descriptive flexfield web bean BranchDescFlex. If this in not intended, please go back to correct the data or contact your Systems Administrator for assistance."
    this error is thrown only when we open existing branches, if we save existing branch and open then it is not throwing any error message.
    Please let us know reason behind this error message.
    Thanks,
    Mruduala

    You are kidding?  It took me about 3 minutes to scroll down on my tab to get to the triplex button!
    Habe you read the error message? 
    Quote:
    java.sql.SQLSyntaxErrorException: ORA-04098: trigger 'PMS.PROJECT_SEQ' is invalid and failed re-validation
    Check the trigger and it should work again.
    Timo

  • Required G?L accounts for Low Value Assets configuration

    Hi Experts,
    Please suggest me, what are the required G/L accounts for    FI-AA integration i.e OAOA for Low Value assets.
    Waiting for the reply.
    Regards,
    Vani.

    Hi Vani,
    You need to assign separate GL accounts for LVA if you intend to create them as a separate class with different account determination,screen layout etc.
    Otherwise the same GL accounts that have been assigned to the regular Asset classes, can be used for the flow of data relating to APC value of LVA and the depreciaiton.
    Hope I have given the required info.
    Regards
    Phani

  • Same variant for different value in enumerations

    Hello.
    Is it a bug?
    I have this type in my schema:
    <xs:simpleType name="VolumeUnit">
    <xs:restriction base="xs:string">
    <xs:enumeration value="ml"></xs:enumeration>
    <xs:enumeration value="µl"></xs:enumeration>
    </xs:restriction>
    </xs:simpleType>
    In the generated class I got:
    static final Enum ML = Enum.forString("ml");
    static final Enum ΜL = Enum.forString("µl");
    static final int INT_ML = Enum.INT_ML;
    static final int INT_ÎœL = Enum.INT_ÎœL;
    What do you think about that?
    How could we manage the generated code

    Hi Advait,
    From the below what I understand is that you are not able to do value mapping for the follwoing
    1     A
    2     A
    3     B
    As value mapping allow one to one mapping only. Please do it like as mentioned below
    1     1*A
    2     2*A
    3     3*B
    Then in the graphical mapping of Integration Repository do the mapping for the same as shown below
    source field > VALUEMAPPING> UDF--> TARGET Field
    In UDF suppress the value of  1* , 2* , 3* which can be done as follows
    create one UDF with one input field
    //write the code as below to suppress the field
    return input.substring(2);
    Here the davantage of using 1* , 2* , 3* etc is that you have the option to use value mapping for 100 values which I think is not normally the case for any Interface.
    If you have same source you can do the same thing for that.
    Hope this helps you to resolve your query.
    Thanks & Regards
    Prabhat

  • Is the number of histogram pixels the same for each channel within each layer?

    Dear Photoshop Scripting Forum:
    I have written a script to isolate the number histogram pixels for each channel within each layer of a file.
    However, I have found some unexpected results: That, the number of pixels is the same for each channel within each layer.
    For example,
      Layer 1 has 18,979 pixels by itself, and so does each channel within it (Red, Green, and Blue)
      Layer 1, Channel Red, has 18,979 pixels
      Layer 1, Channel Green, has 18,979 pixels
      Layer 1, Channel Blue, has 18,979 pixels.
    This does not seem right to me.
    Does someone else have the same experience, or knowledge of something else?
    I am wondering if there is a bug in my script.
    If need be, I will post the script, but it's kind of long for a forum.
    Thank you.

    The following is for RGB 8bit images.
    The red historgram is an array of red values of the pixels that range from 0 to 255. Each element in the array has the number of pixels that have that red value. So for example if you had a layer that is pure red 255,0,0 all the pixels would be in the 255 element and there would be no pixels in the other elements. The red historgam still has the same number of pixels as the layer. They are just all in one histogram element( they all have the same value ).
    But even if you know that all the pixels in a layer are all in the last element(255) of the red histogram you still don't know the color of the pixels. A white pixel has a red value of 255. So does a yellow, magenta, etc pixel. If you only know the red value of a pixel the pixel could be one of over 65000 colors. Most of which would not be considerd 'red'
    It is the three channels together that detemine a pixel's color. Unless the layer is one color you can not tell the color of the pixels from looking at the histogram.
    Unless you use the color range selection then get the histogram of the selection. Even then you need to decide what color value make up 'red'

  • Maybe you are looking for

    • Dr/Cr Indicator instead of (-) & (+)

      Hi All, In Line item display of Vendor, Cut, GL -SAP standard is showing for Credit amount  indicator and Debit amount indicator, but instead of this indicators can we use Dr / Cr indicators. Thanks in Advance Javed

    • RSNAST00

      Hi friends, What is RSNAST00 and in what reference we use this. In one of our old programs they were using this RSNAST00 to print out the report output. Now I am asked to add email functionality to it. Is there any option in RSNAST00 to do email atta

    • Dbms_alert package

      Is it possible to use the dbms_alert package from within jdbc to react on events?

    • Low broadband speed

      My internet speed is around 100kbps these are my speed test results and hub stats could somebody please advise on what it could be. ADSL Line Status Connection information Line state: Connected Connection time: 0 day, 00:45:18 Downstream: 7,104 Kbps

    • HI I AM NEW TO PORTAL

      HI I AM STARTING NEW IN TO PORTAL CAN ANY ONE PLEASE SEND ME THE DOCUMENTATION ON INRODUCTION, ITS USE AND SOME SCREEN SHOTS IF POSSIBLE