Forum Discussion

TyroneGrey's avatar
TyroneGrey
Qrew Member
3 years ago

Formula Query Sorting

Does slist and option=sortorder work within formula queries?

In my formula query my items return the correct values but the sort does not work. Also does num-# work with the amount of records you want returned.

var text Query ="{27.EX." & [Order Type] & "} &slist=3&options=sortorder-D";

------------------------------
Tyrone Grey
------------------------------
  • Late to the game here and not sure if this solves your specific use case, but if you're just needing them numbered in order dynamically based on your query you could use the Size function.  

    For Example if i have 1,000 students on the students table related to a Class on the class table, I could sort them by Date/Time they signed up for the class and then record ID by saying 

    //assume Date Joined is fid 30, Related Class is fid 20, and RID is 3 (per default)

    var number position = Size(GetRecords("{3.LT.'"&[Record ID#]&"'}AND{30.LT.'"&[Date Joined]&"'}AND{20.EX.'"&[Related Class]&"'}"))

    //add 1 to start index at 1 instead of 0

    $position+1

    This gives you the number of students that joined the Class they're Related to before the current record telling you if they were first (because the query = 0 and then we add 1) 545th or 1000th

  • Sorting is not currently supported.  One assumes they are watching how Performance is going and being cautious before allowing more load on the system.

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • BlakeTaylor1's avatar
      BlakeTaylor1
      Qrew Member

      Has sorting been an implimented mechanic?



      ------------------------------
      Blake Taylor
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend

        .... no change on sorting as far as I'm aware.



        ------------------------------
        Mark Shnier (Your Quickbase Coach)
        mark.shnier@gmail.com
        ------------------------------
  • Hi Tyrone;
    I don't think this would work.
    In your "Query" you don't have only query you have also sorting and sorting option
    GetRecords formula doesn't accept sorting parameters yet; if I know it correctly

    For the number of records you can use "Count" function. I wanted to see number of records so I have created a numeric formula field in my application to capture that.
    it is something like this:
    Count(ToText(GetFieldValues(GetRecords($myquery, "xxxxxxx"), 3)), ";")+1

    I hope this will help.


    ------------------------------
    Razi D.
    Desta Tech LLC
    razi@destatechs.com
    ------------------------------