Selection of a column in a table based on a value

Hello

I'm stuck with a little problem here. I need to fill a column based on a value. I have an xml that looks like this to make it simple. (Don't worry, I'm not managing the status of a stock of candy ;-)))
I have to build in rtf.

<? XML version = "1.0" encoding = "UTF-8"? >
-< ROWSET >
-< ROW >
< CANDY > Bubble gum < / CANDY >
without SUGAR < > < / SUGAR >
< / ROW >
-< ROW >
< CANDY > candy cinnamon < / CANDY >
without SUGAR < > < / SUGAR >
< / ROW >
-< ROW >
< CANDY > candy Gummy < / CANDY >
< SUGAR > < / SUGAR >
< / ROW >
< / LINES >


I have a table with two columns. I need to put on the left column candy SUGAR-free"and right the"tart ".
Is there a condition to get there. Or what I have to do two table a column next to each other and adapt if condition in the for each.

Best regards

Olivier

Have the same structure of table with two columns and each conditions in each of your columns.
Say in column1: text to be printed
Column2: text to be printed

Hope this is what you want

Tags: Business Intelligence

Similar Questions

  • How update the column in the table based on the value selected in apex4.1

    Hi all
    I have the following tables,
    leave_type table,it has the following fields,
    1.emp_name,
    2.sick
    3.casual
    and it has the values as follows,
    emp_name                  sick             casual
    guru                           10                10
    mishra                         10                10
    leave_master table and it includes the following fields
    1.emp_name,
    2.leave_type
    3.no_of_days
    I have the form based on the table "leave_master"
    Here, the leave_type has the LOV which includes.
    sick and casual.

    When the form is filled out and clicked on the button submit,
    I need to update the column leave_type in table leave_type,
    for example,.
    if 
    emp_name:guru
    leave_type:sick
    no_of_days:3
    then I want to update the leave_type column,
    sick sick = - no_of_days for the 'guru' of name
    That is to say, ill = 10-3 = 7

    then the leave_type of the table must be,
    emp_name                       sick             casual
    guru                                 7                10
    mishra                              10               10
    someone can such me what code or method I can use?
    Thank you.

    Published by: Gurujothi on May 24, 2012 21:54

    Published by: Gurujothi on May 24, 2012 21:54

    Try something like this...

    BEGIN
    IF: PXX_LEAVE_TYPE = "Sick" THEN
    UPDATE LEAVE_TYPE
    THE PATIENT VALUE = SICK -: PXX_NO_OF_DAYS
    WHERE EMP_NAME =: PXX_EMP_NAME;
    ON THE OTHER
    UPDATE LEAVE_TYPE
    DEFINE CASUAL = CASUAL -: PXX_NO_OF_DAYS
    WHERE EMP_NAME =: PXX_EMP_NAME;
    END IF;
    COMMIT;
    END;

  • 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.

  • Selectively hiding a row in a Table based on the value of the column

    I have a data control that is populated from pro-grammatically, based on the user's selection in the page one of wanting to hide some lines on page 2 at the same time, I don't want to delete the value binding, is there to hide the lines instead of column?

    To the table of the ADF, to hide the lines according to the requirement, use the visible property on each of the columns.

    For example, if you do not want to display all the lines that have IDs Director like 200 or 201.

     
                            
                                
                                    
                                
                            
                            
                                
                            
                            
                                
                            
                            
                                
                            
                        
    

    Thank you
    Nini

  • Select all radio buttons in a table based on the value of selectOneChoice

    Hi all

    I have a selectOneChoice with two values

    positive i.

    II. negative

    1.png

    created vo and am

    I have an adfTable with selectOneRadio added as a transitional attribute.

    The table is created on the vo.

    2.png

    what I have to do is, when the user select positive of selectOneChoice all the positive radiobutton in the adfTable must be selected and the same for negative also.

    3.png

    I can get the value of the selectOneChoice in the bean using valueChangeEvent.

    But I need assistance in the selection of all positive values in adfTable using the selectOneChoice value.

    Reference would be useful.

    Thank you very much

    Kind regards

    Jean-Felix

    Hi all

    Let me post the answer, hope this helps someone.

    selectOneChoice

    Positive P

    N negative

    on selectOneChoice event ValueChangeListener

    to loop through the rows of the adfTable

    If valueChangeEvent.getNewValue () is equal to 'p '.

    Assign PositiveRadiobtn attribute 'p '.

    otherwise set it to "n".

    Kind regards

    Jean-Felix

  • Error when selecting all the columns in the table

    Hi all

    When I write a query by selecting all the columns of the table fromo using * function as well as another new column, I get the error,

    Select *, to_char (hiredate, 'fmday') day

    WCP

    where to_char (hiredate, 'fmday') ('Monday');

    ERROR on line 1:

    ORA-00923: THE KEYWORD not found where expected

    I need all the columns in the table with the column user-defined 'day '. Is there a way I can get the result like this?

    Hello

    padders wrote:

    Alias table to use...

    Or the name of the table, for example

    Select emp.*, to_char (hiredate, "fmday") as day

    WCP

    where to_char (hiredate, 'fmday') ('Monday');

    The bottom line is that * must be qualified (with a table name or alias) when the SELECT clause includes anything else besides *.

  • Is there an easy way to filter a 2D table based on the values in two fields?

    Y at - it an easy way to filter a 2D table based on the values of one of the fields. In my attached VI the output array has the following format:

    Ident Frame Type bytes TimeStamp data

    10:57:07.621 3AD00016 POUVEZ 8 0000000000000000 data frame

    10:57:07.622 3AD00017 CAN data frame 8 000005E000000000

    10:57:07.624 3AD00018 POUVEZ 8 0000000003300000 data frame

    10:57:07.625 2DC00000 POUVEZ 8 0000000000000000 data frame

    10:57:07.626 3AD00019 POUVEZ 4 0000030000000000 data frame

    I would like to delete all lines that do not have an "Ident" between the values of 3AD00000 and 3AD0001E. So for the data above the fourth row would be removed. The only way I can see to do this is to form a 1 d table. Is there a better approach?

    Thank you.

    Hi chuck72352,

    After you've sorted your data, you can use the function InRange. Combined with a "search in 1 table D", you get the range you really want.

    Mike

  • Deactivation of the column in a table based on the setting in the search box

    Hi all

    I use Oracle Apex 4.1. I have two region

    1. search box

    2. in the form of a table

    In the search box, I have a LOV field where the user can select the value. Based on this LOV in the search box, tabular column f06 must disable or read-only.

    For example if I select THREE in LOV then only column f06 is expected on the other it must disable. How to get there.

    Thanks in advance

    Ravi

    Hi Bobo,

    Hope link below will solve your query.

    Disable the column in a table.

    BR,

    Patrick

  • Is it possible to select only one column of a table for the redaction?

    Hi, converted a Word doc with a table in PDF format.  You will need to write a single column of the table.

    Is it possible to select only one column for the redaction?  When we select and drag downwards, it selects the other columns in the following lines.

    With the help of Acrobat X Pro.  Any help is appreciated.

    Hold down the CTRL key and drag a selection.

  • How to highlight the line of the ADF table based on the value of the column?

    Hi all

    I use jdev 10.1.3.4. I want to highlight a table row or a cell based on the value of the column.

    Lets say, I have a table emp with column empid, empname and sal. I want to emphasize the lines that have sal = 10000.

    How can I achieve this? Please help me with this.

    Thank you
    Abhijit

    Hello

    You want to highlight the lines? or set a different color for the lines? If it's the second, you can set the inline style based on the salary. (+ Edit: well, never mind, both are same :)) +)

    Something like

    
    

    If you want the entire line to be a different color, you have 2 options.

    1. define the same style inline for all columns in the table (good if you want to do only for a single table).
    2. create a style class and apply the styleclass based on the value of sal (preferably if you want the same behavior in all of your application).

    Arun-

    Published by: joel Ramamoorthy, October 23, 2009 16:56

  • Name of the dynamic property of object in the table based on the value of a variable

    I have two paintings of custom class objects

    var obj1:Object1
    var obj2:Object2
    
    var array1:Array = [obj1[0], obj1[1], ...]
    var array2:Array = [obj2[0], obj2[1], ...]
    

    Object1 has a property named. Name while Object2 has a property named. Title.

    Now I have a common function including cab accepts an array (array1 or array2) and the name of property the object ("Name" or "Title") as input and needs to access this name of the property of the objects in the array:

    function myFunction(arr:Array, fieldName:String)
    {
        arr[0].fieldName  = "xxx";
    }
    

    the problem I have this achievement does not because the code in the function assumes that the property of that object in the table is actually a string "fieldName" while I want to dynamically determine the names of the fields based on the value of this variable, but cannot understand the syntax to do!

    Don't know if I'm clear - hope that makes sense... ;-) Thank you

    Hey p3pp3r,

    I think I understood you. Try the following and see if you get good results:

    function myFunction(arr:Array, fieldName:String)
    {
        arr[0][fieldName]  = "xxx";
    }
    

    Let me know how it turns out. Good luck!

  • How to create a dynamic RTF report that creates dynamic columns based on the selection of dynamic columns in a table?

    Hi all

    Suppose I have table, whose structure changes frequently on a daily basis.

    For example. / / desc my_table gives you after the name of the column the day 1

    SQL > my_table DESC;

    Output

    Name

    Age

    Phone


    Day 2, two other columns are added, viz, address and salary.

    SQL > my_table DESC;

    Output

    Name

    Age

    Phone

    Address

    Salary


    Now, I want to create a Dynnamic RTF report which made extracting data from all columns from my_table daily. For this, I have defined a simultaneous program with XML output type and include in annex a data/definition of data model that takes XML as input and gives the final result of the conc program in EXCEL layout. I am able to do that for a constant number of columns, but don't know how to do it when the number of columns to display dynamically changes.

    For 1 day my XML file should be like this.

    <?xml version="1.0" encoding="UTF-8"?>
    <dataTemplate name="XYZ" description="iExpenses Report" Version="1.0">
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    SELECT Name
    ,Age
    ,Phone
    FROM my_table
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_my_table" source="Q2">
      <element name="Name" value="Name" />
      <element name="Age" value="Age" />
      <element name="Phone" value="Phone" />
    </group>
    </dataStructure>
    </dataTemplate>
    
    

    And my day 1, EXCEL output RTF model should be like this.
    Name age phone

    Swapnill 23 12345

    For 2 days my XML file should be like this. With 2 new columns selected in the SELECT clause.

    <?xml version="1.0" encoding="UTF-8"?>
    <dataTemplate name="XYZ" description="iExpenses Report" Version="1.0">
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    SELECT Name
    ,Age
    ,Phone
    ,Address
    ,Salary
    FROM my_table
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_my_table" source="Q2">
      <element name="Name" value="Name" />
      <element name="Age" value="Age" />
      <element name="Phone" value="Phone" />
      <element name="Address" value="Address" />
      <element name="Salary" value="Salary" />
    </group>
    </dataStructure>
    </dataTemplate>
    
    

    And my day 2, exit EXCEL model RTF should be like this.
    Name address telephone pay

    23 12345 Madrid 100000 Swapnill

    Now, I don't know below things.

    • Make the dynamic XML as we did in the day 1 there are 3 columns in the SELECT statement and the day 2, 5 columns. I want to create a dynamic XML which must not be changed if the new columns are added into my_table. I don't know how to create this query and also create their corresponding items below.
    • Make the RTF model dyanamic as day 1 there are 3 exit EXCEL columns and the day 2, 5 columns. I want to create a dynamic RTF model that would display all the columns selected in XML dynamic. I don't know how the RTF will create new XML tags and how it will know where to place them in the report. Means, I can create model RTF day 1, by loading the XML data for 3 columns and place 3 tags XML in the model. But how he will create and place the tags for the new columns the day 2?

    Hope so, you got my requirement, it's difficult. Please let me know how I can implement the necessary solution using the RTF dynamically without any manual intervention.

    Kind regards

    Patricia K.

    Post edited by: SwapnilK

    Hi guys,.

    I was able to solve above the requirement.

    I created a procedure that would create & update (attached to the data definition) XML file dynamically for each race. This dynamic XML contains the SQL statement for the data query that is built dynamically. I am updating this XML file using XDOLoader utility to the definition of data. Then run my program customized to generate the excel output.

    Exit excel retrieves correct number of columns dynamically (3 on Day1 and Day2 5), with corresponding data records.

    Kind regards

    Patricia K.

  • Dynamically partition a table based on different values of a specific column: possible?

    I'll start by explaining my problem, so that you can have a global vision of the problem and perhaps suggest another solution. Problem: I have 2 tables with millions of records. Records are added daily, and so each row in each table has a column of "insertion_date".

    C1 C2 ... C10 insertion_date (type date, ofc)
    

    lines are cleaned according to the insertion_date parameter. This can happen in two ways:

    1 - whenever an application error appears. In this case delete is based on a single day and would be like:

    delete from T1 where insertion_date=##;
    

    in other words remove us the lines added and then restart the program (business logic, can't change it)

    2. every two weeks the data associated with these two weeks are deleted because will be most used:

    delete from T1 where insertion_date between ## and ##; (a two weeks period here)   
    

    Delete is currently very slow: it takes abot 8 minutes just to remove approximately 5 M of records (with the same insertion_date), I can't even imagine the time required to delete records more.

    So, here's my idea!

    I would partition my DB according to the value of insertion_date.

    To remove case 1 I would simply delete the partion associated with this insertion date, to remove scores of cases 2 associates at that interval.

    For the needs of my application at most 15 were leaving are present each time (maybe 20 if I want to keep last at least 5 days of data), so the documented limit of 64000 partitions is not a problem.

    Real problem is that I do not know insertion_date values in advance, so my question: is it possible to automatically create a new partition every time presents itself a new value of insertion_date?

    And please correct me if I'm wrong, if I accomplish partitioning that I wouldn't need to edit above right queries? I know just the faster removal time am I correct?

    No - it isn't bog standard range partitioning partitioning interval

    But perhaps you're citing 9i documentation for a reason?

    It is a feature of 11g... then only about 10 years.

    create table t1
    (col1  date)
    partition by range (col1) interval (numtodsinterval(1,'DAY'))
    (partition po values less than (to_date('01-01-2015','DD-MM-YYYY')));
    
    table T1 created.
    
    select table_name, partition_name, high_value from user_tab_partitions where table_name = 'T1';
    
    TABLE_NAME                     PARTITION_NAME                 HIGH_VALUE
    ------------------------------ ------------------------------ --------------------------------------------------------------------------------
    T1                             PO                             TO_DATE(' 2015-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA...'
    
    insert into t1
    select trunc(sysdate,'MM')+rownum-1
    from   dual
    connect by  rownum <= 10;
    
    select table_name, partition_name, high_value from user_tab_partitions where table_name = 'T1';
    
    TABLE_NAME                     PARTITION_NAME                 HIGH_VALUE
    ------------------------------ ------------------------------ --------------------------------------------------------------------------------
    T1                             PO                             TO_DATE(' 2015-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA...'
    T1                             SYS_P450383                    TO_DATE(' 2015-07-02 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA...'
    T1                             SYS_P450384                    TO_DATE(' 2015-07-03 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    T1                             SYS_P450385                    TO_DATE(' 2015-07-04 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    T1                             SYS_P450386                    TO_DATE(' 2015-07-05 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    T1                             SYS_P450387                    TO_DATE(' 2015-07-06 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    T1                             SYS_P450388                    TO_DATE(' 2015-07-07 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    T1                             SYS_P450389                    TO_DATE(' 2015-07-08 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    T1                             SYS_P450390                    TO_DATE(' 2015-07-09 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    T1                             SYS_P450391                    TO_DATE(' 2015-07-10 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    T1                             SYS_P450392                    TO_DATE(' 2015-07-11 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIA ...'
    
  • How to upgrade all the record for a particular column in a table based on search criteria.

    Hi all

    I'm new to ADF. I have a requirement where I have to perform the update of mass on a table.

    Scenario:

    Ex: I have a search region manual dept. where I search with deptId: 20. I get 20 records in my table. now I have another area where I have an inputchoice list that contains all the column names that exist in the dept table. Beside that, I have a text box and a button update

    The user now, first research with dept id: 20 and click on the button Search, where it shows 20 record in the table. He then select an input choicelist(ex: ManagerId) column, then enter the new value in the decision-making box(ex: abc) then click on the button update.

    Now, I want to, all the records in the ManagerId column with dept id: 20 update with the new value 'abc '.

    Can someone help me with the code.

    Thanks in advance...

    Hello

    If you go to your VO and generate the ViewObjectImpl, here you can create a method that contains two parameters, 1 the name attribute and 2 the value.

    Then you can follow something as explained in this post:

    ADF tutorial: how to apply actions in bulk to a view object lines

    The only difference is that you must create a method like this:

    ' Public Sub updateAttribute (attribute String, Integer value) {}

    RowSetIterator iter = createRowSetIterator (null);

    While (iter.hasNext ()) {}

    Line = iter.next ();

    row.setAttribute (attribute, value);

    }

    }

    Then execute you who expose a customer interface and then after you filter your table according to your criteria just this method passing the correct parameters.

    Concerning

  • Pick up the names of tables based on the value of the column

    I have a scheme in which I have 10000 tables and I want to pick up the names of tables in the schema where org_id is not equal to 1,
    Note: Org_id here is the column name.

    Could you please provide sql code me or a procedure to achieve this.

    Thanks in advance.

    This lthread can help

    How to find the column name and the name of the table with a value

Maybe you are looking for

  • New App - 'Top Stories' &amp; ' stories»

    Hello I like the new App, or like. Since the update I have to see 'Top Stories' & 'Stories of a trend' in the application which contains the subjects, I have absolutely no interest. This means rather than to have my nice in the media of photography,

  • NaN correlation coefficient

    Correlation coefficient vi Labview 2013 for two tables 1 d of zero, r values is NaN.I don't know why?

  • FAILURE TO INSTALL UPDATES FOR VISTA ERROR - MS SERVICE PACK 4 - 663

    I'M USING THE VISTA OPERATING SYSTEM - CAN NOT INSTALL MICROSOFT SUITE SERVICE PACK4 - ONLY GIVE 663 ERROR MESSAGE - THE PROBLEM WAS APPEARING FOR ABOUT A MONTH NOW AND HAS DETERIATED THE COMPUTER PERFORMANCE - A TI BOTHERS ME A LOT

  • Lose internet when I turn off printer (WUSB600N)

    I'm having a very strange problem.  When I turn off my Canon MX850 printer connected USB, I lose my internet connection.  I get this error message in my event viewer: Event type: WARNINGEvent source: DhcpEvent category: noEvent ID: 1009Date: 11/03/20

  • Updated BIOS for Compaq F700 computer laptop Windows 7 OS

    I am trying to upgrade the BIOS for Compaq F700 computer laptop F.04 to F.08 worm! I can do it under Windows 7 OS (the sp39468 WinFlash file is recommended under Vista environment)? Thank you