Assign a value based on a condition of the varaible

How can I assign a conditional numeric value to a variable based on the value of an xml tag. That is if she is 'company A' give it 12 if it is 'company B' 17. Also be able to use this value later in the model.


Thanks in advance

Use this:


To retrieve and print its value later in the model simply put:

It is documented here:

http://download.Oracle.com/docs/CD/E12844_01/doc/BIP.1013/e12187/T421739T481157.htm#4535390

Please spend some time to read the documentation for it.

concerning

Jorge

Tags: Business Intelligence

Similar Questions

  • How to enable or disable a paragraph based on a condition in the BIPS

    Hello reading,
    <? country? >
    How to display a line based on a condition in the DARK...
    I have a tag as a country that has the value zero or in India, I shouldn't show paragraph
    para should be included
    and also, I don't want the line below to access his location

    How can I do this...
    pls help

    I sent you the code to achieve this. Take a peek inside.

    Thank you
    BIPuser

  • assign a value to a text element using the PL/SQL function body

    Hello

    I want to assign a value to a text element using PL/SQL function body option in the Source elements. But the below error when I try to apply it.

    Source code:

    declare
    name varchar2 (100);
    Start
    If v ("P3_CREHIDD") = 'Edit' then
    Select ename in the name of cpy_emp where empno = v('P3_EMPNO2');

    end if;
    end;


    ERR-1904 unable to calculate the default item: type = computation_type = function body declare name varchar2 (100); so start v ('P3_CREHIDD') = 'Edit' and then select ename in the name of cpy_emp where empno = v('P3_EMPNO2'); end if; end;.

    Thank you
    David.

    Hello

    Your body of the function doesn't return anything.
    Maybe it works

    declare
      l_name varchar2(100);
    begin
      if v('P3_CREHIDD') = 'Edit' then
        select ename
        into l_name
        from cpy_emp
        where empno = v('P3_EMPNO2');
      end if;
      RETURN l_name;
    end;
    

    BR, Jari

  • Assignment of values to text to use in the calculation

    Hi, I have extremely limited experience script and am quite stuck trying to get something to work. Any help would be appreciated.

    I have a combo box (ComboBox1) with three other areas of text with three different Option A and Option B Options (or Option C) with numbers in them (NoBox1, NoBox2, NoBox3), I want to use to add up to a total figure.

    Yes ComboBox1 + NoBox1 + NoBox2 + NoBox3 = Total

    I want to assign a numerical value to the text options in the combo box so that I can use in the calculation. Let's say Option A = 8, B = 12 & Option Option C = 16

    Thank you

    Each combo box item can have an assigned value export, so just set it to the number, you want to use for each item. The value of exports of the selected item will become the value of the field to the drop-down list box.

    If more than one element is to use the same export value, it is best to use a different approach, so report it again if this is the case and I'll give you more information.

  • AF:Switcher, handfuls of line column values based on another column in the table

    Hello

    I have a question if you can help me on this. It's on af:switcher.

    What I'm trying to do this - is in a table of the adf, based on the value of a column, I want another column to display as a link or not.
    For example, if the status column is 1, then the id column display as a link (I just put a h:outputLink around outputText to do), if it is then show him without bond.

    For this I put two different facets and opportunities switcher to decide what facet of show which line.

    BUT what is happening is that only on opportunities is made. Either / or scenario. It is not made each line according to the value of the status column.

    What is planned.

    I just tried with the dept table.

                    
                    
                    
                      
                    
                    
                    
                        
    
                      
                    
    

    The lines for which the deptno > 20, I wanted to display the pass as link and for the deptno<=20, log="" will="" be="" an="" input="" text.="" it="" works="" fine="" for="" me.="" probably,="" you="" may="" need="" to="" get="" rid="" of="" h:outputlink="" and="" use="" commandlink="" golink="">

    Arun-

  • How to assign a value of string comman separated in the Clause of SELECT m

    In table A, I followed values

    Price ID
    -- ------
    1 100
    2,200
    3 300
    4 400
    6 500

    Now, in table B, I have following values

    Product price combi
    --------- ----- --------
    OIL 600 '1', ' 2 ', 3'

    What I do is, first of all get the combi in table B value and then get the count of the table has.

    In condition, it should return 3...

    create or replace procedure amit_combi_test
    as
    v_combi varchar2 (100);
    tot_row number (10);
    cursor table_combi is
    Select combi
    b;

    BEGIN
    OPEN table_combi.
    LOOP
    EXTRACT the table_combi in v_combi;
    EXIT WHEN table_combi % NOTFOUND;
    dbms_output.put_line (v_combi);

    Select count (1) INTO tot_row
    a.
    WHERE ID in (v_combi);

    dbms_output.put_line (to_char (tot_row));

    END LOOP;

    CLOSE Table_combi;
    END;

    But the problem is... it shows the value of the variable tot_row = 0; It should come 3...

    ace_friends22 wrote:
    Thank you all, but it seems regexp_ functions and xmltable are not available in Oracle 9.2... I tried to use it, but it says invalid identifier......

    So why it is always a good idea to display the version of your database with your question, especially if you use a version not supported by the database, otherwise we have to assume that you use one of the latest versions supported. This saves also we are wasting our time.

  • How to assign a value to an attribute column in the table in the ADF

    Hi all

    BindingContext ctx = BindingContext.getCurrent ();
    DCBindingContainer bc = (DCBindingContainer) ctx.getCurrentBindingsEntry ();
    Iterator DCIteratorBinding = bc.findIteratorBinding ("StudentVO1Iterator");
    Line r = iterator.getCurrentRow ();

    FacesContext facesContext = FacesContext.getCurrentInstance ();
    Application app = facesContext.getApplication ();
    ExpressionFactory elFactory = app.getExpressionFactory ();
    ELContext elContext = facesContext.getELContext ();
    ValueExpression valueExp =
    elFactory.createValueExpression (elContext, "#{data.") StudentAMDataControl.dataProvider} "(,Object.class);"
    AMEST StudentAMImpl = (StudentAMImpl) valueExp.getValue (elContext);
    String newno = amest.getEstNoGenerate ();

    System.out.println ("new number" + newno);
    r.setAttribute ("StudentNo", newno);

    BindingContext ctxdet = BindingContext.getCurrent ();
    DCBindingContainer bcdet = (DCBindingContainer) ctxdet.getCurrentBindingsEntry ();
    DCIteratorBinding iterdet = bcdet.findIteratorBinding("StudentDetailVO1Iterator");
    Line rdet = iterdet.getCurrentRow ();
    System.out.println ("row" + rdet);    print null
    rdet.setAttribute ("DtlStudentNo", newno);

    in code above my header part can affect return value, but the level of detail, it cannot affect. which shows nullpointer exception. because the Row rdet object become null. Why does this happen? it comes out when I press a button.
    I code in backing bean Tin and running on the commercial version of jdeveloper 11g 2...
    help jumping... anyone who knows...
    Thank you.

    A good starting point are the docs (http://docs.oracle.com/cd/E28280_01/web.1111/b31974/bcentities.htm#sm0126).
    Example http://dstas.blogspot.de/2011/10/master-detail-data-presentation-and.html

    Timo

  • Hide an entire column based on a condition

    Hello

    I'm trying to completely hide a column in a table based on a condition, if the column was not present. I wrote two conditional regions for the header and data, but it is still showing up. Any help would be appreciated. The XML model RTF, the PDF generated and the output I'm looking is attached. Thank you.

    Please check your email that I have forwarded to update the model.

    I counted occurrences of January in your xml and formed the condition based on the fi

    MONTH

  • Error ESTK "cannot assign a value.

    Dear friends, started a new project - and of course the new problems:.

    The SumOf (list of values) function works perfectly,

    but an equivalent of the function VsumOf (list of variables) stops at line 16 in the first iteration of the loop: cannot assign a value.

    At this point, the result variable is just - 132.09 - out sort of a numerical problem.

    var z = SumOf (11.1, -11.9, 12345679.0, -12345679.0, 124.5, -17, 18.9, 2.2, 2.5, 2.5, 2.5, 31.31, 312345679, -312345679); 
    alert ("SumOf the numbers = " + z); // giving 166.610000014305  (figures after the 000 are artifacts)
    
    var z = VsumOf (11.1, -11.9, 12345679.0, -12345679.0, 124.5, -17, 18.9, 2.2, 2.5, 2.5, 2.5, 31.31, 312345679, -312345679); 
    alert ("VsumOf the numbers = " + z);
    
    function VsumOf (valuePairs) {
      var nArguments = arguments.length;
      var j, z, result = 0;
      if (Math.floor(nArguments/2) * 2 !== nArguments) {return undefined;}
      
      for (j = 0; j < nArguments; j=++2) {
        if (isNaN(arguments[j])) {return NaN;}        // should be skipped in calling environment
        if (isNaN(arguments[j+1])) {return NaN;}
        z = arguments[j] * arguments[j+1];
        result = result + z;                          // <<== Can not assign value ???
      }
      return result;
    }
    
    // this one works correctly
    function SumOf (values) {
      var nArguments = arguments.length;
      var j, result= 0;
      for (j = 0; j < nArguments; j++) {
        if (isNaN(arguments[j])) {return NaN;}        // should be skipped in calling environment
        result = result + arguments[j];
      }
      return result;
    }
    

    Any ideas what really does this error message mean?

    Hi Klaus,

    Just change your line 12 for

      for (j = 0; j< narguments;="" j="j+2)" {="">

    It should work.

  • XQuery insert node and assign the value based on an XPATH expression

    Hello

    I am trying to write a function that receives an XML as input parameters and return updated XML output

    -nodes are removed from the input XML code

    -a node must be inserted and the node value must be 1 or 0, based on an XPATH expression

    I discovered how to remove nodes, I discovered how to insert a new node, but I can not set the value of the conditionally inserted node an XPATH expression.

    Here's my current procedure and below a sample of one XML of entry. I use Oracle 12 c.

    CREATE OR REPLACE FUNCTION STRIP_XML
    (
      IN_XML IN SYS.XMLTYPE
    ) RETURN SYS.XMLTYPE AS
    p_result XMLType;
    BEGIN
      select
          xmlquery(
             'declare default element namespace "http://mad.evs.com/search"; (: :)
              copy $d := .
              modify (
      delete node $d//MainCategory/@logId,
               delete node $d/MainCategory/@id,
    -- a lot more of those delete node
     -- insert a node, but the value 1 is conditional
               insert node <DMZ>1</DMZ> after $d/MainCategory/SDataSection/EventDate)
              return $d'
            passing in_xml
            returning content
            ) into p_result
            from dual;
    
    
      RETURN p_result;
    END STRIP_XML;
    

    The condition for the value of is


    HASPATH (//DigitalAssets/DigitalAsset [@ available = "true" and @videoFormatId = "11"] / VideoLocations/Videorental [@typeId = "8"]) then 1 else 0


    It is complex because DigitalAssets/DigitalAsset is a collection. Here is an example of an XML to entry



    <MainCategory xmlns="http://mad.evs.com/search" id="9" logId="3349" logType="3">
      <Name>Sport</Name>
      <Serie id="163" externalId="557">
      <TitleAKA>UCL 2006/07</TitleAKA>
      <DigitalAssets available="true" som="20:28:49:05" dur="00:02:46:04" videoDurationMinutes="3">
         <DigitalAsset available="true" som="20:28:49:05" dur="00:02:46:04" videoDurationMinutes="3" videoFormatId="3">
            <VideoLocations>
                <VideoLocation id="3" path="003349MA.mxf" typeId="1" locationId="1" priority="0"/>
                <VideoLocation id="3" path="003349MA.mxf" typeId="2" locationId="1" priority="0"/>
                <VideoLocation id="3" path="003349MA.mxf" typeId="5" locationId="1" priority="0"/>
             </VideoLocations>
          </DigitalAsset>
          <DigitalAsset available="true" som="20:28:49:05" dur="00:02:46:04" videoDurationMinutes="3" videoFormatId="11">
             <VideoLocations>
                <VideoLocation id="101" path="003349MA.mpg" typeId="1" locationId="1" priority="0"/>
                <VideoLocation id="101" path="003349MA.mpg" typeId="2" locationId="1" priority="0"/>
                <VideoLocation id="101" path="003349MA.mpg" typeId="8" locationId="1" priority="0"/>
             </VideoLocations>
          </DigitalAsset>
      </DigitalAssets>
      <SDataSection xmlns="http://mad.evs.com/search">
        <EventDate>2006-08-09</EventDate>
        <LogType>3</LogType>
      </SDataSection>
    </MainCategory>
    


    In this case, because HASPATH expression could be set to true, the value of the added node must be 1.


    Any help or advice how I should fight against that would be appreciated. I have no experience with XML and XQuery, I create my function through from trial and error of the doc.


    Thanks and regards, Pierre

    Hi Pierre,.

    You can use the if-then-else statement, like this:

    Insert the node

    {

    If ($d/MainCategory/DigitalAssets/DigitalAsset[@available="true' and @videoFormatId = '11'] / VideoLocations/Videorental [@typeId = '8'])

    then 1

    0 otherwise

    }

    After $d, MainCategory, SDataSection, EventDate

    XSLT can be an alternative to the XQuery Update in this case.

  • conditionally to assign a value to a parameter

    I use this code to conditionally to assign a value to a parameter p_data_type:

    <? If: H_ACCOUNT_HIER_DESC = 'IS '? > < param name = 'p_data_type' select = '' number' ' xdofo:ctx = 'start' / > <? end if? >
    <? If: H_ACCOUNT_HIER_DESC = "BY"? > < param name = 'p_data_type' select = '' text' ' xdofo:ctx = 'start' / > <? end if? >

    However, I get the following error.

    Caused by: oracle.xdo.parser.v2.XMLParseException: duplicate definition of variable 'p_data_type '.

    Once I get this job, I want to use it as follows:

    <? sorting: current-group () / ACCOUNT_SEQ; ' ascending '; type_donnees = "{$p_data_type}"? >

    Does anyone have any suggestions on how I could do this?

    Thank you
    TAM

    You can't do that, follow below

    
      
    
    

    And you can view it as $p_data_type

  • How to disable the LOV values based on the State of some?

    Hello

    I have a requirement like this.

    (1) LOV Field (1), when I get a value here then based on the query I get two new values and assign to another two LOV Fields (2,3) and then disable them. However, when I enter the value in the field LOV (1) based on one of the conditions I won't have no default value then LOV fields must be enabled so that the user can select the values of LOV.

    (2) now an another LOV domain (4) when I go here again, then again two fields a LOV (5), and the free text field must be filled in.

    To do this, I wrote the logic in the following way:

    (1) get the LOV box-1 value and deriving the new values and set the session Variable to 1 and then refresh the Page. Now in PR get the Variable from Session 1 and assigning new values to LOV fields 2 and 3 and then using the property Setdisabled I deactivation.

    (2) getting the value of LOV field-4 and then drifting two new values and set the session Variable-2 and refresh the Page. Now in PR get Session-2, and then set the new values for the LOV-5 field and free text. But once the Page Refreshed and assigning values, values that we have given in the Point 1 in the LOV-2 fields, 3 turn white and field's get activated.

    Can you please let me how to achieve this? and also why the values are empty when I implement Point-2.

    Thank you
    Clarriiza

    Clarriiza,

    This VO have no matter what right SQL query, so even if you run the VO by using vo.executeQuery (), you will not get all the lines in the VO.

    So in the PR you need createRow and insert VO (otherwise your page no mistake) the below blog can be considered as an example.

    Reference: Oracle tips of Johny: OAF: how to create a PVO and use for Spel link in Oracle Application Framework

    On top of which is explained in the blog above, you set the values for the attributes of the useful, likely to set the value for the other LOV.

    I hope this helps.

    See you soon

    AJ

  • change the color of line based on the value of column 5 Apex in the classic report

    Version of the apex 5.0.0.00.31

    Standard universal theme

    Page theme default template

    Classic report

    Foldable report template

    Hello

    I know this question has been asked several times here, but I'm working on 5 Apex and need to know the correct way to do it in this version.

    I need to change the color of the text of the entire line (no background color) based on the value in one of the columns of the classic report. I have just two conditions, if the value of column = Yes, color should be red, otherwise it must be green.

    I am new to jscript and css, so appreciate if someone can tell me the solution with steps.

    I have already checked this link that changes the value of the column, need to do something similar to the whole line.

    https://tylermuth.WordPress.com/2007/12/01/conditional-column-formatting-in-apex/

    Hi coolmaddy007-Oracle,.

    Here's an example set up on the apex.oracle.com according to the specifications you gave: https://apex.oracle.com/pls/apex/f?p=35467:1

    Version of the apex 5.0.0.00.31

    Standard universal theme

    Page theme default template

    Classic report

    Foldable report template

    Here is how it is done:

    Create a dynamic action with the following specifications:

    Name: Give the appropriate name

    Event: After refresh

    Selection type: region

    Region: select your region classic report

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: Yes

    Code:

    $('td[headers="JOB"]').each(function() {
      if ( $(this).text() === 'MANAGER' ) {
        $(this).closest('tr').find('td').css({"color":"red"});
      }
      if ( $(this).text() === 'SALESMAN' ) {
        $(this).closest('tr').find('td').css({"color":"green"});
      }
      if ( $(this).text() === 'CLERK' ) {
        $(this).closest('tr').find('td').css({"color":"blue"});
      }
    });
    

    NOTE: Download the selector appropriate for your knowledge $('td[headers="JOB"]') case using firebug/browser development tools.

    Items concerned: leave blank.

    PS: Changed the example to change the color of text instead of the background color.

    I hope this helps!

    Kind regards

    Kiran

  • Calculate values based on the boxes are checked - for Dummies...

    Hello and thank you all in advance for your help. I'm trying to calculate a value based on the boxes checked. Specifically, I would like to add a particular value $$ each CheckBox and if this box is checked, I want to add to the total rental value (see screenshot below):

    Screenshot (1).png

    As you can see in the screenshot that I have different areas that can be selected (first floor, court before, etc.), I want to assign a value to the checkbox of each region (and added value for others) and calculate a total in the "Balance of rental fees" less the deposit. I'm new with java and scripts but not know how to do it in an excel formula. I guess it's very different from what little I know of Java. Any help you can give me would be greatly appreciated.

    Calculation options are in the text field. In this screen, you only need to set the value of exports to the amount this box represents.

  • Displaying an icon for each record, based on a condition

    Hi people,
    I'm developing an application that uses forms 6i with oracle 10g. I have the "Grant" and "Deny" options in my application. I have also two icons is TICK icon and next is WRONG icon.according to the corresponding status icons ("granted" or "Refused") should be displayed for me.for this i have used multi-record block composed of 10 documents. Here is my sample code.
    IF :STATUS.C_STATUS = 'GRANTED' THEN
              Set_Item_instance_Property('status.tick',VISIBLE,PROPERTY_TRUE);
                   Set_Item_instance_Property('status.tick',DISPLAYED,PROPERTY_TRUE);
                   Set_Item_Property('status.wrong',VISIBLE,PROPERTY_FALSE);
                  set_item_property('status.wrong',DISPLAYED,PROPERTY_FALSE);
                     .............
    Using this code, I am able to get the visibility of icons, but it affects the entire column. For example, if the first status of cases is "granted" then TICK icon should appear to runtime.similarly if second status of cases is "denied" then ERROR icon should be displayed for me.but for me that the TICK icon is displayed for all 10 records if the State of the first record is "granted". How do the visibled corresponding icons according to status ("Granted" or "Refused"). Kindly give me a solution.

    Published by: vidusnat on May 2, 2012 12:26

    Hello

    Well, I don't think you can do it by making visible or invisible button/item. I can share an idea to create two image files a given and one for refuse. Multi record block you create an element of the image (non-database) and read the image on this element in the post (at the block level) based on the State values that you so condition...

    TRIGGER = POST-QUERY (BLOCK-LEVEL)
    IF :STATUS.C_STATUS = 'GRANTED' THEN
      READ_IMAGE_FILE('image_path\access_given.JPG','JPG','BLOCK_NAME.IMAGE_ITEM_NAME');
    ELSE
      READ_IMAGE_FILE('image_path\access_denied.JPG','JPG','BLOCK_NAME.IMAGE_ITEM_NAME');
    END IF;
    

    -Clément

Maybe you are looking for