Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Column sorting in rpd file

Received Response
71
Views
5
Comments
Charles M
Charles M Rank 6 - Analytics Lead

Hi.

I am trying to sort a column, in the rpd file, in descending order. The data type of the column is varchar2. Here is a look at it now, from the filter condition:

pastedImage_1.png

I would like the last record to appear as first (at the top). For the above example, it would be 'DEC-2016-'.

I can provide additional details to help give a better understanding of what has been don so far.

OBIEE 11.1.1.9.3

Regards,

Charles

Answers

  • Hi,

    In the RPD you don't really define sorting ASC or DESC on columns, they are naturally sorted (so ASC).

    Now if you really want you can specify for your column a sorting column, so a different column used to define the sort of your original column.

    This is what is generally done for columns with months in a format like "Jan 2017", "Feb 2017" etc. To sort them based on the month you generally set a sorting column having a format like 2017-01, 2017-02 etc.

    In your case as you want a descending sorting you will have to provide that kind of column in the data source (so running a ranking function with the required order by clause to force the order you want).

    You can also of course simply sort it in analysis etc. but it will need to be done by hand all the time ....

  • Thomas Dodds
    Thomas Dodds Rank 8 - Analytics Strategist

    +1 to "In your case as you want a descending sorting you will have to provide that kind of column in the data source (so running a ranking function with the required order by clause to force the order you want)."

    OR

    a more complex function to place the P##- rows in order and the MON-YYYY rows in order and specify a priority of P## or MON-YYYY coming in the list

  • Joel
    Joel Rank 8 - Analytics Strategist

    As @Thomas Dodds and @Gianni Ceresa have mentioned this is typically required for textual date fields. This RANK column will then be used as the sort order column for your logical column

    sort order.PNG

  • Charles M
    Charles M Rank 6 - Analytics Lead

    Thank you Gianni ... very good information!! - - Thanks for the additoanl replies as well, very helpful @Thomas Dodds @Joel Acha

    We were able to use the method you provided. However, we are facing an issue with the outcome ... because we are dealing with concatenated columns. In my original posting, I did not show the additional names (which are separated by hyphens).

    Part of the result is correct, but some is not. We're looking at this to understand why this is happening.

    Regards,

    Charles

  • John_K
    John_K Rank 5 - Community Champion

    Don't sort by a descriptive column - sort by your chronological key.