3 Replies Latest reply on Mar 11, 2012 10:17 AM by michaelhallak0

    Conditional sort based on the selection in a Quick Filter

      I have a series of lat/long markers that correspond to road segments within a route from city to city. Routes can fit into two categories - Vertical routes that go North/South, and Horizontal routes that go East/West.

       

      I run into trouble when I want to display the route on the map. I use Line marks, and if i don't sort the Path shelf properly, the line zigzags at random to different points along the route rather than following spacial order. I have two different dimensions that I use to sort the path. One dimension works for vertical routes, and the other dimension works for horizontal routes. Different routes are selected via a quick filter on the name of the route. Is there any way that I can change the sorting method based on the route name selection in the quick filter, like some sort of lookup table that assigns a different sorting dimension? I basically need to sort horizontal routes by one dimension, and vertical routes by a different dimension. I have attached a TWBX with 4 sheets that I believe pretty clearly illustrate the problem.

       

      my two sorting dimensions:

      LATandLONG defined as: str([StartLat])+str([StartLong]) //works for Vertical routes

      LONGandLAT defined as: str([StartLong])+str([StartLat]) //works for Horizontal routes

       

      Any help here would be wonderful,

       

      Thanks,

      Michael

        • 1. Re: Conditional sort based on the selection in a Quick Filter
          Tracy Rodgers

          Hi Michael,

           

          That would be a great feature, being able to sort based on a specific selection. I would recommend adding this to the Ideas section of Community.

           

          Currently, I cannot think of a way to do this. The best I can come up with is to separate the horizontal and vertical routes onto separate sheets.

           

          -Tracy

          • 2. Re: Conditional sort based on the selection in a Quick Filter
            Shawn Wallwork

            Hi Michael, interesting map. Where did you get all the routing lat/longs? By hand using Google Maps, or did you find a database? Anyway see attached for a way to get the sorting you're looking for. Here's basically what I did:

             

            Michael-1.PNG

            Created this calc field and placed it on the level of detail shelf. It will mess up your routes until you change it to an ATTR(). Once you've got it there then open up your TMC9 pill on the path shelf and edit the sort. Use the new calc to sort on:

            Michael-2.PNG

            You can use min or max, it doesn't matter. (But you can't use count.) Now all your routes work, except I noticed an anomaly on the Bal-Phil route:

            Michael-3.PNG

            But the Phil-Bal route is fine.

             

            Not sure your strategy for setting the path is ideal, but then if it works hey go with it! Hope this helps. (And I just saw Tracy beat me to the punch again, but I'll post anyway just in case this happens to be more of what you're looking for.)

             

            --Shawn

            1 of 1 people found this helpful
            • 3. Re: Conditional sort based on the selection in a Quick Filter

              I checked the twbx you attached and I like it! It is a bit more manual than I would hope... Perhaps including a column called "IsVertical" filled with boolean values, and follow this approach but based on the boolean state as opposed to a more thought out mapping would make the most sense for larger datasets of more than 6 routes. Thanks a bunch! I will be using this in the interim.