Sort Alphanumeric string in OBIEE answers

Hi...
I have a time slot column in my table. I holds data as follows,
10AM-12PM
9AM-11AM
11AM-1PM
How to sort the report with these column. If i sort it, it was showing data as follows.
10AM-12PM
11AM-1PM
9AM-11AM
Can u please help to reslove the issue

If you are specifically trying to use a string function to resolve your issue, then you can try below.
Pull another slot column in your Answers request and use evaluate function, to derive a timestamp (using oracle to_date funtion) column. Then you can sort this column and hide it in your report.
Something like below can be used derive timestamp from say '10AM-11AM':
select to_date(substr('10AM-11AM',1,instr('10AM-11AM','-')-1),'HHAM') from dual --Output 2011-09-01 10:00:00
Similarly,
select to_date(substr('10PM-11PM',1,instr('10PM-11PM','-')-1),'HHAM') from dual --Output 2011-09-01 22:00:00
See if it suits your requirement.
Thanks

Similar Messages

  • Parse String in OBIEE Answers.

    Please can someone help me to know how to parse a string in obiee answers:
    Eg: 'Administrators;XMLP_ADMIN;319'.
    I can do this very easy in Java but not sure how to do it in OBIEE. Appreciate your help
    Regards.

    Hi,
    what are you expecting to do with that string? can you be more specific?
    you want to have all values before the semi colon?
    you can use regexp in obiee to parse these kind of strings..
    i think this must be helpful to you..
    http://oraclebizint.wordpress.com/2009/06/04/oracle-bi-ee-10-1-3-4-1-handling-complex-string-manipulations-using-regular-expressions-regex-and-evaluate/
    if its helpful award points
    thanks,
    karthick
    Edited by: kart on May 28, 2010 3:56 PM

  • OBIEE Answers

    how can i compare string in obiee answers
    Awaiting the reply
    Bala

    set LTS level for f1 and f2 (and for each metric) for the non-joining dims at Total or highest level in the Logical layer.

  • Sort in OBIEE Answers - Desc Nulls Last

    I want to sort Desc on a Answers column, but want NULLS last. Where do I set it?
    For instance I can write SQL
    select * from T1 order by c2 Nulls first;
    NULLS last is default behavior in Oracle SQL
    However, via OBIEE Answers, I see when I use DESC Nulls are on top, I want them on bottom.
    Where should I set it?

    Hi shyamvaran,
    What is the value of your "NULL_VALUES_SORT_FIRST" parameter in your NQSConfig.INI file? By default, this is set to OFF. Which is probably what your seeing i.e. if NULLs are last, and you are sorting in descending order, then you would expect to see NULLs first.
    If you want NULLs to show up last when sorting in descending order, then set the above parameter to ON and bounce your services. That should take care of you.
    Otherwise, you can do a work around. Create a hidden column in your report. Set it's formula to IFNULL(C2,'aaaaaaaaaaa') . This way it'll be alphabetically first i.e. last in descending order. Set this column to sort descending and then set it to hidden. It should sort your report in the desired order and it should be hidden from view.
    Good luck and if you found this post useful, please award points!
    Best regards,
    -Joe

  • Finding the smallest letter in a single alphanumeric string

    How do I find the smallest letter in a single alphanumeric input?
    I already wrote and successfully tested the code that takes an alphanumeric string as input, separates the number from the alphabet, and creates a new alphabetic string. However, I'm unsuccesful in writting the code to find the smallest letter within the alphabetic string. I am almost certain that the easy answer is Arrays.sort, but I unsuccesfully tried writing the code to place the alphabetic string into an array. I researched compareTo, but I do not have another object to compare?! Any suggetsions?

    Ahh flaimbait - I'm sure I'll get criticized for this... but - while we are talking about time-to-market, etc...:
    The most important issue in development is to make sure that you understand the project requirements. The requirements in this situation were:
    Find the smallest character in a string.
    Given that, then any developer that goes through the trouble of looking up the sort APIs, etc... is not helping themselves - all they really needed to do was to write one line of code (as xxxx graciously posted):
    for (int x=0; x<foo.length(); x++) if (foo.charAt(i)<low) low=foo.charAt(x);I absolutely guarantee that any Java programmer could write the above faster than they could figure out how to split a string appart by characters, look up the arraysort API, etc...
    The arraysort functions are EXTREMELY efficient, and I would never suggest that someone re-implement them. The point here is that just because you've got a wrecking ball available, you can still use a hammer to drive a nail.

  • How to sort alphanumeric values in datagrid numerically

    Hi all,
    I have a datagrid column which contains AlphaNumeric values.Is there a way i can sort these values in a numerical order
    eg:
    having d1,d11,12,13,d2,d3,d4
    d2 should come after d1..
    order should be d1,d2,d3,d4,d11,d12,d13
    Please help me out..if any have any idea..giving below thw code which is sorting as string
    protected function ColumnSortCompare( obj1:Object, obj2:Object ):int
            if ( !obj1 && !obj2 )
                return 0;
            if ( !obj1 )
                return 1;
            if ( !obj2 )
                return -1;
            var obj1Data:String = ComplexColumnData( obj1 ).toString();
            var obj2Data:String = ComplexColumnData( obj2 ).toString();
            if ( obj1Data < obj2Data )
                return -1;
            if ( obj1Data > obj2Data )
                return 1;
            return 0;
    Thanx in advance
    Rajesh

    Hi,
    Thanks for the reply. Please dont mind if the question is simple,as I am new to flex.
    While I am using
    return ObjectUtil.stringCompare(obj1[fieldName], obj2[fieldName]);
    it is throwing error as, undefined property fieldName.
    I am calling as this
    <mx:DataGridColumn headerText=""
                               editable="false"
                               sortCompareFunction="ColumnSortCompare"
                               textAlign="left"
                               dataField="{PORT_NAME}"
                               width="150"/>
    How I can resolve this.Please guide me.
    Thanks,
    Raj

  • How To Give a Validation In Prompt(OBIEE Answers)

    Hi,
    I ahve the promt like
    Name----------------<text box> Go
    if i enter the name then the prompt will effect on the data.
    if i didn't enter tha data in name textbox it should dispaly a meassge like:please enter a valid name:
    here name comling from backend database to obiee answers
    can u please tell me how to sort out this-----------------

    Check this MOS note:
    OA Framework Personalization and Extensibility Guide: Version 5.7+ (Doc ID 236618.1)
    thanks

  • Sort a string :: Please help.

    Hello Everyone,
    I am having this very simple problem of sorting a String. please help.
         static String sortString(String str){
              List list = Arrays.asList(str);                    
              Collections.sort(list);
              for(int i=0, n=list.size();i<n;i++){
                   System.out.println(","+ list.get(i));
    The function is supposed to take a String and sort it & print it out. This should be simple. Where am I making mistakes? Please help!!

    Hello Everyone,
    I am having this very simple problem of sorting a String. please help.
         static String sortString(String str){
              List list = Arrays.asList(str);                    
              Collections.sort(list);
              for(int i=0, n=list.size();i<n;i++){
                   System.out.println(","+ list.get(i));
                   return str;
    The function is supposed to take a String and sort it & print it out. This should be simple. Where am I making mistakes? Please help!!

  • Problem in sorting numeric string

    hii
    i have created one method using comparator and passed a list with list of strings as argument to sort method of Collections class.The string ,which is combined a string and numeric value for example A1,A2,A11,A3 .....So i wanted the result as A1,A2,A3..A11,A12... and so on as final output.but when i print the output ,they are sorted as A1,A11,A12....A2,A3....so i learned from javadoc why those are sorted as like since comparator is using charAt() method while making override compare() method.but i am not expected this sorting for my application. i need sorting output as A1,A2,A3...A11,A12.....How to compare a string with another string both have combination of string and number using java?
    if any one know the logic reply me.
    i have pasted my code,if any changes have to be made only in this code,correct the code.
    package sample.sorting;
    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.Comparator;
    import java.util.List;
    public class SortString {
         public static List<String> sort(List<String> data) {
              Collections.sort(data,new Comparator<String>(){
                   public int compare(String s1,String s2) {
                        return s1.compareTo(s2)     ;
              return data;
         public static void main(String[] args) {
              List<String> sortList     = new ArrayList<String>();
              sortList.add("A1");
              sortList.add("A3");
              sortList.add("A2");
              sortList.add("A9");
              sortList.add("A11");
              sortList.add("A6");
              List<String> sort = sort(sortList);
              for(String str : sort) {
                   System.out.println("STR :: "+str); // O/P : A1,A11,A2,A3,A6... but expected O/P : A1,A2,A3..A11.
    }thanks in advance.
    with regards
    Oasisderts
    Edited by: oasisdesert on Dec 29, 2009 4:15 AM

    In the compare method of the comparator, check if two Strings have equal length, if so compare them as normal, otherwise treat them as a separate case.
    e.g. uncompiled return s1.length == s2.length ? s1.compareTo(s2) : if(s1.length < s2.length) -1 else 1;Mel

  • How can I sort a string

    Hi,
    I want to sort a string (daycode), I use the daycode to sort my data. Now i want to sort the daycodes, but i do not know how.
    Example: the daycode is a10r, so a is the first shift in week (b the second and so on), 10 is the week in year, r is the year.
    Now i have a array with daycode-strings and want to sort it to year, week, shift (normaly it is sorted to the first letter).
    Someone with a good idea???
    Thanks a lot
    Marco

    Try this vi and see if it is something you might be looking for and if not maybe you could explain a little more about what you want to do.
    Joe.
    "NOTHING IS EVER EASY"
    Attachments:
    sort.vi ‏15 KB

  • Random alphanumeric string

    Hi,
    I need one function which generates a Random alphanumeric string which I want to use as a primary key value. So it must be unique too.
    Something similar to sys_guid in oracle, However I need length of the string fixed to be 6. sys_guid is not helpful as it generates 32 characters long string.
    Can somebody help please?
    Thanks in advance!
    RK

    You can find many examples by doing a search on this forum:
    Alphanumeric sequence number generator

  • Sort / compare Strings   SOS ... ___ ...

    Hi, sorry I'm novice in Java, and I'm trying to make kind of bubble sort on String MyArray[]. God ! I just found out that I can't compare Strings i.e. Objects like:
    if ( MyArray[i] > MyArray)...
    Can anybody recommend me a not too complicated solution, preferebly without imports..
    Thanks
    Mario

    Hi.
    String.compareTo(String anotherString) is what you need. Have a look at http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html#compareTo(java.lang.String)
    Regards,
    Lance
    Lance Walton - [email protected]
    Team In A Box - Software without Tragedy
    http://www.teaminabox.co.uk

  • Having probs with radix Sort for strings

    I am creating a method that does radix sort for string values. I think I need to know the maximum value for strings to do this, and I have no Idea what that would be

    As in the maximum size of a string?
    Do you mean characters or actual byte size?

  • Generate random alphanumeric string as pk

    Hallo,
    I want to generate a random and unique alphanumeric string (4-digit).
    Uniqueness is very important, because it will be used as primary key.
    Is this supported by oracle 10?

    You can try the sys_guid function:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for Linux IA64: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    SQL> select sys_guid() from dual;
    SYS_GUID()
    439F46B40AAAFB59E04014ACAE650DC1
    SQL> create table guid_tbl(str varchar2(300), constraint guid_tbl_pk primary key
    (str));
    Table created.
    SQL> begin
      2  for i in 1..1000 loop
      3     insert into guid_tbl(str) values(sys_guid());
      4  end loop;
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> select count(*) from guid_tbl;
      COUNT(*)
          1000
    SQL>Amiel

  • Generating alphanumeric string

    Hi,
    I'm new to java programming and
    I was wondering if anyone could help.
    I need to generate an alphanumeric string
    consisting of one uppercase letter and 4 digits.
    Ant help gratefully received

    import java.util.Random;
    public class Test {
      private static final char[] uppercaseLetters = { 'A', 'B', 'C', 'D', 'E', 'F',
        'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'R', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
      public Test() {
        final StringBuffer sb = new StringBuffer();
        sb.append(uppercaseLetters[(int)(Math.random() * uppercaseLetters.length)]);
        for (int i = 0; i < 4; i++) sb.append((int)(Math.random() * 10));
        System.out.println(sb);
      public static void main(String[] args) {
        new Test();
    }

Maybe you are looking for