Sort a column as a numeric value

Hello

I created a SQL report from collections and problems with the sorting of the column as a numeric value.

I used create_collection_from_query2 for my digital set as a variable n001. But, when I use the same in my SQL statement, it is considering the column as a string.

Please advise if I am doing something wrong that is causing this problem.

Thank you in advance,

Madan

Thanks for the reply fac586.

Is to help sort the value column, but we hide the column, users do not have it sort by themselves.

I have solved this problem by using the interactive report and did not apex_item.display_and_save () but used n001 column directly in the select statement. It is allowing me to sort as a numeric value.

Tags: Database

Similar Questions

  • How to interpret the numerical values of SQL_ColType()?

    Hello

    After the execution of:
    ..
    Call SQL_Connect("abcDB","user","pw","") ' abcDB is an ODBC link to my Mysql 5 database
    Call SQL_ExecDirect ("SELECT id, temperature, tsdat FROM v$ _header WHERE id")< 1000")="">
    ..

    > the SQL_ColType(1..ColumnNo) variable shows me the data types of each column to a numeric value, for example:

    SQL_ColType (1) = 4
    SQL_ColType (2) = - 9
    SQL_ColType (3) = 93

    What real data types are behind the values? It would be nice to get a complete list of all possible values?

    Thank you.

    Hi ddehn,

    The SQL_... orders () are the old method for DIAdem to connect to SQL databases, using the ODBC approach.  Since the tiara 10.2 the ADO approach is the recommended method.  This is the function that I used to use to make sense of the values SQL_ColType():

    Function GetODBColTypes()
    Dim j, jMax, ChTypes
    jMax = SQL_ResultCols
    < 1="" then="" jmax="">
    ReDim ChTypes (jMax)
    FOR j = 1 TO jMax
    IF SQL_ColType (j) = 93 THEN
    ChTypes (j) = "DateTime".
    Else if SQL_ColType = - 1 OR SQL_ColType (j) (j) > 8 THEN ' STRING
    ChTypes (j) = "String".
    ON THE OTHER
    ChTypes (j) = 'number '.
    END IF ' SQL_ColType (j)
    NEXT ' j
    GetODBColTypes = ChTypes
    End Function ' GetODBColTypes()

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • text field with numeric values for sorting

    I'm having a problem my sort. Usually, when the column follows a format, I can use a combination of INSTR and LPAD to sort correctly. In this new case, my columns does not follow a specific format.

    Sample data:
    with t as(
    select 'xxx 10 MG yyy' sortcol from dual union
    select 'xxx 5 MG yyy' from dual union
    select 'xxx 28 MG yyy' from dual union
    select 'aa 10% 12.5 ' from dual union
    select 'aa 6.25% 12.5' from dual union
    select '222 zzz 30/17.5' from dual union
    select '222 zzz 30/5.5' from dual
    )
    select * from t
    
    SORTCOL
    222 zzz 30/17.5
    222 zzz 30/5.5
    aa 10% 12.5 
    aa 6.25% 12.5
    xxx 10 MG yyy
    xxx 28 MG yyy
    xxx 5 MG yyy
    I want to sort the data in the
    222 zzz 30/5.5
    222 zzz 30/17.5
    aa 6.25% 12.5
    aa 10% 12.5 
    xxx 5 MG yyy
    xxx 10 MG yyy
    xxx 28 MG yyy
    I'm trying to replace all numerical values in the string to have 4 digits. For example:

    xxx yyy MG 0010
    xxx yyy MG 0028
    xxx yyy 0005 MG
    0222 zzz 0030/0017.0005
    0222 zzz 0030/0005.0005

    If Oracle will sort correctly digital in the form of text fields. I thought I found the solution with the regular expression:
    select regexp_replace('x10x100x6.5x','([0-9]+)',lpad('\1', 4,0)) from dual
    
    x0010x00100x006.005x
    But the problem is that the backreference in the LPAD overrides the value before it run LPAD. He treats her like the literal string '\1' as oppose to the reference value: 10, 1, 6, and 5. Therefore, LPAD think length is always 2, length ('\1') = 2 instead of length('100') = 3.

    Is there another method to develop all the numbers? Thank you for your time.

    Hello

    You can do with nested REGEXP_REPLACEs:

    SELECT   sortcol
    ,      REGEXP_REPLACE ( REGEXP_REPLACE ( sortcol
                                 , '([0-9]+)'
                              , '000\1'
                              )
                   , '[0-9]+([0-9]{4})'
                   , '\1'
                   )     AS four_digits
    FROM       t
    ORDER BY four_digits
    ;
    

    You probably don't want to display the string converted; you want to just ORDER BY it. It is included in the SELECT clause only if you could see what it was, for the tests.
    Output:

    SORTCOL         FOUR_DIGITS
    --------------- ------------------------------
    222 zzz 30/5.5  0222 zzz 0030/0005.0005
    222 zzz 30/17.5 0222 zzz 0030/0017.0005
    aa 6.25% 12.5   aa 0006.0025% 0012.0005
    aa 10% 12.5     aa 0010% 0012.0005
    xxx 5 MG yyy    xxx 0005 MG yyy
    xxx 10 MG yyy   xxx 0010 MG yyy
    xxx 28 MG yyy   xxx 0028 MG yyy
    

    As you can see, the inner REGEXP_REPLACE adds 3 leading 0 to each number, if she need to 0, 1, 2, or 3. This means that each number will be at least 4 digits, but maybe more. The external REGEXP_REPLACE replaces 4 digits with the last 4 digits only.

    Thanks for posting the sample data in a useful form. The description of the problem was very clear, and it was useful to see that you had already tried and your results on why it does not work. I wish we could mark questions as "Correct." This one was really were.

    Published by: Frank Kulash, January 21, 2011 16:20

  • Add numeric value in the column in the Table

    Hello
    My problem:
    I have a VO with a numeric attribute (Sal). This VO is present in a table in a JSF Page.
    I need to add a numerical value to the value of the column.

    I have try it with #{row.bindings.Sal.attributeValue * 2} or #{rank. SAL + 2} or #{rank. Sal.inputValue + 2} but I get an error.

    Can someone help me?

    Thank you

    11.1.3 JDev

    Hello

    one option would be to use a transitional attribute in the VO to calculate math or to fill in the field column of a managed bean. You can point the field for the column to a property of the managed bean (say sumSal). In this getSumSal() method you

    1. use ELContext and ValueExpression ExpressionFactory to resolve the reference #{line} (you can cast oracle.jbo.domain.Row
    2. call the row.get ("attribute_name") to access the value of the field
    3 compute and return the value to display in the table

    Note that using a transitional attribute may be easier to achieve and easier to reuse in other uses of the VO. However, you will have options

    Frank

  • Strings, the formula = numeric values?

    is there a way of having a cell to display a string numbers, but when this cell is referenced in a formula it will be used as a numerical value? See screenshot.

    I want the storage capacity label.

    I want the strings displayed in column A to represent numeric values in column B.

    then "128 GB" = 0.13. or "128 GB" = B2. I need a cell to associate it with the value of the other.

    My goal is to make a column of pop-ups with storage capacities that can be used in a formula in another table.

    If you choose "128 GB" I want its value to be 0.13

    I prefer to use a table of choice like that.

    (1) create a table (as you have) that contains the list of text and the corresponding values

    I named the 'TaillePour Value' table

    In the table where you want to use, use the following formula:

    C2 = SIERREUR (IF (VLOOKUP (B2, TaillePour Value::A:B, 2, 0) = 0, ' ", VLOOKUP (B2, TaillePour Value::A:B, 2, 0))," ")

    It's shorthand dethrone select cell C2, then type (or copy and paste it here) the formula:

    = SIERREUR (IF (VLOOKUP (B2, TaillePour Value::A:B, 2, 0) = 0, ' ", VLOOKUP (B2, TaillePour Value::A:B, 2, 0))," ")

    Select cell C2, copy

    Select cells C2 at the end of the C column, paste (or as needed)

  • I want to create a 2 cells in demand for numbers, the 1st cell is a dropdown menu with items of text, when choosing an item, that it would be represented by a numeric value in the other cell. How can I do?

    I want to create a 2 cells in demand for numbers, the 1st cell is a dropdown menu with items of text, when choosing an item, that it would be represented by a numeric value in the other cell. How can I do?

    You can use vlookup() like this:

    (1) crate a table like this:

    the first line is a heading row

    the first column contains the same list of items in the context menu

    the second column contains the corresponding values

    name of the table 'value '.

    In another table (where the pop-up menu), you can use the table of choice of 'Value' like this:

    create a drop-down list in cell B1

    Select cell C1 and type (or copy and paste) the formula:

    = VLOOKUP (B1, Value::A:B, 2, 0)

    short hand for this is:

    C1 = VLOOKUP (B1, Value::A:B, 2, 0)

    now change the pop-up to display the value in the change of cell C1

  • I'm on the 4.1.1.00.23 Apex vesion. I've created a classic report and I am trying to sort. Here's how I'm trying to sort by column name. I have TotPGPV with sorting sequence 1 desc and NewTOTPGPV with sorting sequence 2 desc. I have Count1, Count5 with t

    I'm on version 4.1.1.00.23 of the APEX. I've created a classic report and I am trying to sort. Here's how I'm trying to sort by column name. I have TotPGPV with sorting sequence 1 desc and NewTOTPGPV with sorting sequence 2 desc. I have Count1, Count5 with the sort column. What I'm asking is when the report is run can column sorting to default Count1 and Count5 descending instead of the ascendant. I don't see anywhere to set the default value for the sort column.

    Hi - on the report of the page attributes - that you show in your attached screenshot - you can select the columns to sort on the sort sequence as well as the direction of the sort, i.e. for a given column, you can choose to allow sorting on this column, what position this column must be in the sort sequence and whether to sort Ascending or descending by default (i.e. '1' means sort this column first and bottom-up and "1 desc") sort this column first and downhill). Don't forget that once you click on one of the headings of column during execution, it changes your sort settings and these settings are stored in your preferences, that is, they are used again the next time you log in your application and rerun the report.

    Kind regards
    Marc

  • Want to get the records of only numeric values

    I have tables sales_order, with column ATTRIBUTE_8 VARCHAR2 (50) and job_order with column NUMBER HIGH_AMOUNT.

    attribute_8 column of the sales_order table has both numerical values & character values.  For example:-32232.3764, 234283.878, YES, NOT... etc.

    I intend to load data of tabe sales_order to job_order. For all non-numeric values of ATTRIBUTE_8, I want to do as a 0.

    Please indicate an INSERT statement to achieve this.

    create or replace function clean_number(p_string in varchar2) return number is
    begin
      return to_number(p_string);
    exception when value_error then
      return 0;
    end clean_number;
    /
    with input(ATTRIBUTE_8) as (
      select '-32232.3764' from dual union all
      select '234283.878' from dual union all
      select 'YES' from dual union all
      select 'NO' from dual union all
      select '1e4' from dual
    )
    select attribute_8, clean_number(attribute_8) high_amount from input;
    
    ATTRIBUTE_8 HIGH_AMOUNT
    -32232.3764 -32232.3764
    234283.878 234283.878
    YES 0
    NO. 0
    1E4 10000
  • Is it possible to 'ring' selected numerical values easily to an editable PDF file with Adobe Acrobat?

    Hi guys,.

    I work in the film industry and we are looking to use Adobe Reader to create sheets of digital camera report that will connect the crucial information for the editors/vfx production on a highly publicized movie shooting this year. Usually this is done with sheets of paper carbon-copied, but a new trend is to make digitally in order to facilitate life for everyone.

    One of the things as facts easily on paper is the selected circle takes so the laboratory handling film knows how to treat film: this can save a lot of time and money. Shooting digitally the same thing applies, transcode only you some takes, and it makes it easier for everyone.

    My problem with design sheets is implementing in a pdf editable using popular software, the most popular of them are Adobe Acrobat. A numeric value that represents a number to take will be in a column in the pdf file, and I need a way of circling this value to basically a click of a button or similar. Is this possible to do with Acrobat?

    One of the other things it is easy to do on paper is to draw a distinct line when a roll of camera/memory card is changed, if there is a way to make a line in a table "BOLD" again, the click of a button, which would be extremely useful!

    Thanks guys, I look forward to hearing your suggestions!

    The way to do it using the tools of comments. There is none

    built-in component that can be used to surround an element on the page, but

    There are various ways to select an item (boxes,

    Radio-boutons, drop-down menus, list boxes, etc.).

    Sunday, may 10, 2015 at 2:08, rarth_boddomy, [email protected]>

  • Obligation to convert the numeric value to a char

    Hi all

    I have a requirement to convert numeric values in the column the char values.

    For example:

    Column1
    1
    2
    .
    .
    1000

    Result

    one
    two
    .
    .
    a thousand

    Please let me know how I can do it.

    Thanks in advance.

    Best regards
    Pavan

    Published by: Pavan Poirier on February 17, 2011 07:26

    Published by: Pavan Poirier on February 17, 2011 07:27

    If one of the English words are used, and the value is not very high, then this can help you

    select to_char(to_date(1000,'J'),'Jsp') from dual
    
    One Thousand
    

    JSP means: set Julian date format.

  • How can I force an 'invisible' object to become "visible" when a numeric value is entered?

    So I try to force an 'invisible' subform to move to 'visible' when a numeric value greater than or equal to 22 entered in a numeric field.

    I can't get the following javascript code to work correctly with any event. I tried change, calculate, validate, events and a few more useless. The only event that sort of works with javascript code that I use is the validate event. When I enter the code in the validateevent, the invisible subform becomes visible when an amount equal to or greater than 22 is entered, but when AN amount is entered in this field, an error message appears that says "failed validation of NumericField4" and the user must click 'Ok' to get rid of the box pop up.

    if (this.rawValue < = 22) { }

    Approval23.Presence = 'hidden';

    }

    if (this.rawValue > = 23) { }

    Approval23.Presence = 'visible';

    }

    Here is a link to my .pdf: http://www.filedropper.com/salgovform

    The field of the object in the javascript code is called: NumericField4 (aka new Grade of employment)

    The subform that I want to become visible when a number greater than 22 entered NumericField4, is called Approval23.

    I founded the javascript code, I used information I have gathered from the following thread and associates .pdf...

    Thread:

    http://forums.Adobe.com/message/1982919

    PDF in thread with javascript code:

    http://forums.Adobe.com/servlet/JiveServlet/download/1981437-8059/Sample_SW.PDF

    I'm sure miss me just a little thing that throws everything off!

    Any help would be GREATLY appreciated.

    Hello

    The following work in the case of output of the digital field, where the language is set to JavaScript:

    if (this.rawValue <= 22) {
         Approval23.presence = "hidden";
    }
    else {
         Approval23.presence = "visible";
    }
    

    Here is your form: https://acrobat.com/#d=3gRNt6WBY2bE0K7en4CnSA

    Hope that helps,

    Niall

  • type conversion of numeric value in the time format

    Hi guys,.
    I have the column called need .i (time in seconds) to convert the numeric value of a column in time format HH. for example 3012 = 00: 50.12.
    How can I proceed even in the front.


    Thank you and best regards,
    Nandu

    Hi Nelly,

    Pls go through the below formula:
    This deffenitely will help you resolve the issue.

    Concat (concat (concat (concat (cast (floor ((COLUMN_NAME) / 3600) as char), ':'), cast (floor (mod ((COLUMN_NAME), 3600) / 60) as char)),': '), cast (floor (mod (mod ((COLUMN_NAME), 3600), 60)) as char))

    Thank you
    Cognet

  • need to "extract" a numerical value of the given XML node

    My question: -.
    of a document XML how can I 'extract' a numeric value for use in a "customized math expression" to convert inches into millimetres/centimetres dimensional data?

    FYI: -.
    When you use a component XML Connector that I am able to load and display the values of XML data, of my choice, the XML document required; the data is loaded into the components that are instances of TextArea or TextInput.

    background: -.
    in order to make use of the value of XML data I tried to assign it to an 'intermediate and temporary variable' using the ComponentInstanceName.text option in an assignment, but that effort failed, where this post.

    your comments: -.
    all comments, suggestions, ideas are received with gratitude; Please keep in mind that cindy I am a newb to XML format, but hope that change in the coming months.

    Thanks for your time.

    ... and so, I discovered that the main reason for my bad be able to access the data is due to the fact that the xml data is not fully charged in my application when my code is trying to access. of course it's because of the asynchronous loading of the Flash XML Connector component behavior.

    so the repair to the original message is:-
    check that the data is fully loaded into the app and only then access and assign it to all the other required variables.

    SORTING :)

  • Problems with sorting of columns and the number of lines in the report

    Hello

    I'm having a problem with sorting of columns and the number of lines displayed in a report.

    This report displays the data correct, but if I try to sort on a column when I click on the column heading in the report returns no line... I need to click on the "go" button to refresh the report (with the column sorted now) in to display the data.

    Similarly, I display only 15 lines per page. If I try to view the lines 16-30, 31-45, etc., that it returns no line until I click on the 'go' button to refresh again.

    Has anyone else had (and overcome) the same problem?

    Thank you

    Joseph

    Joseph,

    2 questions:

    1) are you using the elements referenced by the report page to filter etc.. ? If so, you're failing values of these when the loading of the page?
    (2) are you using PPR page through the results?

    If so, it could be a problem with the different types of session state, as Anton Nielsen blogged about here:
    http://c2anton.blogspot.com/2008/12/Oracle-Application-Express-Apex-three.html

    If so, you can use calculations or processes to set element values in session state persistent during page rendering, as Anton mentions. In this way, when you use PPR page values will be available in session state and your report should work fine.

    Anthony.

  • Convert a numeric value to text

    First problem-

    Convert a numeric value to text

    Convert currency value in words.

    e.g. Rs. 10, 000 would become rupees ten thousand only

    RS 1,50,749.77 would become rupees one Lakh fifty eight thousand seven hundred forty-nine and seventy seven Paise only.

    Second problem-

    = SIERREUR (IF ($A16 > = $K$ 1, (INDEX (($L$1:$L$40), MATCH ($B16,($H$1:$H$40), 0))), IF ($A16 < = $I$ 1, (INDEX (($J$1:$J$40), MATCH ($B16,($H$1:$H$40), 0))), 0)))

    This formula works in Microsoft excel but displays error while being used in numbers (iwork).

    Number of formula considers only the first part. While giving the equation for the second part it gives the result as FALSE. And when used in number last 0 and support must be removed to get the result. If it is not removed form displays the error message.

    Concerning

    Nishat Gupta

    Hi John,.

    First question needs a lookup table for the translation. I did several years ago for AppleWorks and later Numbers ' 09. Take a look for her tonight.

    I think that neither SGIII nor Wayne Contello done one more early as well. Both were English/North American names and number formats, so a direct copy may not be sufficient.

    Second question:

    A lot of extra parentheses in there! They are not necessary for frame type Beach H1:H40 references. Won't it doesn't work, but they don't add noise when a man tries to ead the formula.

    Here is an example using the addresses in your formula, but omitting the function SIERREUR the part I wanted to see real results, including errors, if any.

    The formula below comes from U16. The title of the image is in U17.

    IF ($A16≥$ K$ 1, INDEX ($L$ 1: $21, MATCH($B16,$H$1:$H$21,0) $L), IF ($A16≤$ I$ 1, INDEX ($ 1 $J: $J$ 21, MATCH ($B16, $H$ 1: $H$ 21.0)), 1))

    In the selected cell (U17) tests in two IF statements returns FALSE, then the FALSE result for the second, it is what is returned.

    To add a SIERREUR function:

    SIERREUR = (formula above,0)

    Kind regards

    Barry

Maybe you are looking for