Options

[SOLVED] Sorted by two or more columns at the same time

ziszis Member Posts: 22 Contributor II
edited November 2018 in Help
Hi,

I have posted a topic http://rapid-i.com/rapidforum/index.php/topic,4951.0.html maybe to wrong Thread. Can I sort two or more columns at the same time?

What I want is same in Manual RapidMiner 5.0+ (English) at http://rapid-i.com/content/view/26/84/ page: 84, Sorting, but I need operator and perform this action on an ExampleSet.

Thanks for ideas,
Regards
Jan

Answers

  • Options
    wesselwessel Member Posts: 537 Maven
    Use the sort operator?
  • Options
    ziszis Member Posts: 22 Contributor II
    Thanks for answer,

    I will explain it on an example: IDNAMEVALUE2Bob5.181Alice5.164Jack4.123Jack4.10
    And I want sort data by ID then by NAME and then by VALUE at the same time. So, the wanted result is:
    IDNAMEVALUE1Alice5.162Bob5.183Jack4.104Jack4.12
    If I use a Sort operator, he sorts data only by one column. If I use sort three times, is used a last sort operator. If last operator is for column VALUE, the result is: IDNAMEVALUE3Jack4.104Jack4.121Alice5.162Bob5.18
    Maybe I doing someting wrong, but result is always same.
  • Options
    IngoRMIngoRM Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University Professor Posts: 1,751 RM Founder
    Hi,

    as (almost) always, the search function brings up something useful on page 1Β  ;) :

    http://rapid-i.com/rapidforum/index.php/topic,3717.0.html

    The trick is to use the Sort operator three times but in reverse order: first on VALUE, then on NAME, and then on ID.

    Cheers,
    Ingo
  • Options
    wesselwessel Member Posts: 537 Maven
    Oh, now I understand your problem.

    What Ingo said works, apply sort in the reverse order.
    This works because if you first sort by VALUE and then sort by NAME, the jack with a higher value will stay on top.
    I.e. it preserves the sorting order for items that have the same NAME when sorting on NAME.

    Best regards,

    Wessel
  • Options
    ziszis Member Posts: 22 Contributor II
    Yes,

    this is it. Fabulous thanks both of you.

    Regards,
    John
Sign In or Register to comment.