Forum Discussion

ROBERTSTEVENS's avatar
ROBERTSTEVENS
Qrew Member
3 years ago

Test list to numeric for Min and Max functions

I was able to get a list of values in a list using: GetFieldValues(GetRecords("{23.EX.'"&[Related Event]&"'}", ""), 3)

However, is there a way to get the MIN and MAX from the list if the result is 3;4;7;8;9;10;11;12  ?

------------------------------
ROBERT STEVENS
------------------------------

3 Replies

  • One would hope that these additional functions like MIN MAX would be rolled out "soon", but no word yet. Until then the only solutions would be a brute force parsing of the returned string into its parts assuming that the expected set retuned was some manageable number of entries like say 20 or maybe up to 50.  Post back if you need help with such a formula.



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

      Thanks for the help. MIN/MAX are available functions, however, they require numeric entries in the format of (1, 3, 7, 18, 4, 6). The problem is the list returned is a text list. I am trying to change the format so the MIN/MAX functions can be used.

      ------------------------------
      ROBERT STEVENS
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Qrew Champion
        OK try this  (assuming that your formula query is correct)

        var text String = ToText(
        GetFieldValues(GetRecords("{23.EX.'"&[Related Event]&"'}", ""), 3));

        Max(
        ToNumber(Part($Value, 1, ";"),
        ToNumber(Part($Value, 2, ";"),
        ToNumber(Part($Value, 3, ";"),
        ToNumber(Part($Value, 4, ";"),
        etc

        ToNumber(Part($Value, 20, ";"))



        ------------------------------
        Mark Shnier (YQC)
        mark.shnier@gmail.com
        ------------------------------