Answers.Body: <p>I was able to accomplish this by just adding both variables to my SuperSort tag. In essence, what I did was this:</p>
  
  <pre><code>{% set fruits = fruits | supersort('natsortas', '{count} {title}') %}
  </code></pre>
  
  <p>It seems to be working in my situation, but if there's a better way to do it, I'm open to suggestions.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-22T17:25:12.040Z
Answers.Text: I changed the sort method to "natsort", to make this work with count numbers greater than 9.
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-22T17:32:23.377Z
Answers.Text: There's one problem with this approach. The supersort "as" methods generate a string form the 2nd parameter and use that to sort by. So it basically compares "2 pineapples", "4 grapefruits", "2 apples",... Because of that you can't have different sort orders for each property, so it's either both ascending or not.
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-22T16:42:33.817Z
Answers.LastActivityDate: 2015-10-22T17:21:06.050Z
Answers.LastEditDate: 2015-10-22T17:21:06.050Z
Answers.UserDisplayName: Andrew Philpott
Answers.Body: <p>I just gave it a play and found a simple solution to get them ordered by count in descending order
  and them by title in ascending order:</p>
  
  <pre><code>{% set fruits = fruits|supersort('natsortas', '{{ (9999-object.count) ~ object.title }}') %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-22T18:01:39.207Z
Answers.LastActivityDate: 2015-10-22T18:01:39.207Z
Answers.UserDisplayName: carlcs
Body: <p>Is there a way with SuperSort to sort an array by multiple variables? For example, let's I have the following data and I want to sort by count and then alphabetically:</p>
  
  <pre><code>pineapples (2)
  grapefruits (4)
  apples (2)
  bananas (3)
  </code></pre>
  
  <p>Ideally, I would want that to be sorted as:</p>
  
  <pre><code>grapefruits (4)
  bananas (3)
  apples (2)
  pineapples (2)
  </code></pre>
  
Tags: <plugin-supersort>
Title: SuperSort - Sort by multiple variables
ThreadText: # SuperSort - Sort by multiple variables
  
  (Asked by: username_0 on 2015-10-22)
  
  Is there a way with SuperSort to sort an array by multiple variables? For example, let's I have the following data and I want to sort by count and then alphabetically:
  
  ```
  pineapples (2)
  grapefruits (4)
  apples (2)
  bananas (3)
  
  ```
  
  Ideally, I would want that to be sorted as:
  
  ```
  grapefruits (4)
  bananas (3)
  apples (2)
  pineapples (2)
  
  ```
  
  **Tags:** plugin-supersort
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2015-10-22. Score: 4
  
  I was able to accomplish this by just adding both variables to my SuperSort tag. In essence, what I did was this:
  
  ```
  {% set fruits = fruits | supersort('natsortas', '{count} {title}') %}
  
  ```
  
  It seems to be working in my situation, but if there's a better way to do it, I'm open to suggestions.
  
  > **Comments:**
  > **username_1**: I changed the sort method to "natsort", to make this work with count numbers greater than 9.  
  > **username_1**: There's one problem with this approach. The supersort "as" methods generate a string form the 2nd parameter and use that to sort by. So it basically compares "2 pineapples", "4 grapefruits", "2 apples",... Because of that you can't have different sort orders for each property, so it's either both ascending or not.  
  
  ---
  
  ### Answer by username_1 on 2015-10-22. Score: 1
  
  I just gave it a play and found a simple solution to get them ordered by count in descending order
  and them by title in ascending order:
  
  ```
  {% set fruits = fruits|supersort('natsortas', '{{ (9999-object.count) ~ object.title }}') %}
  
  ```
  
  
  ---
  
  