Sorting "Month" name is Date...

Ram Vanga
2009-12-17
2012-10-08
  • Ram Vanga

    Ram Vanga - 2009-12-17

    Hi EveryBody,

    Is there a possibility to sort Month Names in Date type dimention -

    when I use QD.sort() - I get the following output -

    • February
    • January
    • March

    Instead, as you all know that the correct order is

    • January
    • February
    • March

    How do I accomplish this in OLAP4j - Any help ?????

    -thanks
    Ram V

     
  • Julian Hyde

    Julian Hyde - 2009-12-18

    If you are using Mondrian, set the ordinal property of the month level to the
    ordinal of the month in the year (Jan=1, etc.), and the natural order of the
    members of the month will be the correct one.

     
  • Luc Boudreau

    Luc Boudreau - 2009-12-18

    I understand that you are using the Query.java class as your base class for
    your query and that by "QD" you means QueryDimension. I second Julian's
    suggestion. The Query Model is not aware of the underlying meaning of string
    literals (nor should it be). Your best solution is either to :

    • Add a column in your dimension table to define explicitly every member order and tell your OLAP server to use that column to order the level members;
    • Populate your dimension table with entries in the right order and tell your OLAP server to use the natural order.

    Whatever option you use, don't use QueryDimension.sort() and your members will
    keep their natural order.

    Luc

     
  • Ram Vanga

    Ram Vanga - 2009-12-18

    Hi,

    Thankyou Julian and Luc.

    Yes, I am using Query.java and QD refers to QueryDimension. and we are using
    Mondrian OLAP server.

    In this case, I wolud prefer to go with Julians suggestion to have it modified
    in my cube.xml and that will be of greate use if we can that in QD
    functionality list.

    I am really impressed with your quick response and am seriously considering
    OLAP4j with FLEX frontend.

    I have couple of other BLOCKERS which I vl post it here with clear
    discription.

    -thanks again

    -Ram V

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks