0

Trying to get a Max numeric calculated value

I have a table with a bunch of weights. I had asked this basic question before, but the table's structure has changed.

The table is called Weights and there's a calculated field called "CalcValue".

I'm trying to display in another calculated field the max calcValue, like this:

Let x:= this
x = max(select Weights).'calcValue'

"False" displays for all values instead of the single maximum value in the column.

--

It would be helpful if there were some kind of query console built in to help debug these (for me, anyway) endless problems with basic data selection.

Thanks in advance.

8 replies

null
    • Ninox partner
    • RoSoft_Steven.1
    • 1 yr ago
    • Reported - view

    Only one line:

    max((select Weights).CalcValue)

      • Jim.5
      • 1 yr ago
      • Reported - view

      RoSoft_Steven It was literally just the parens needed!

      Working now.

      Thanks very much. :)

    • Fred
    • 1 yr ago
    • Reported - view

    Steven is correct.

    Ninox either

    1) allow the code to go through since there is no error message

    or

    2) shouldn't allow it and error out.

    bad form on Ninox's part.

    • Ninox developper
    • Jacques_TUR
    • 1 yr ago
    • Reported - view
    Jim said:
    Let x:= this x = max(select Weights).'calcValue'

    Var x := this is a record: nid("D1")

    Select Weights returns an array of records (nid) whose values are the full ID of the record (id of the table + id of the record): nid(["D1","D2"])

    Use max on such a table (max(select Weights) ) return undefined : nid(undefined)

    X = max(select Weights) is a comparison (= and not :=) between nid("D1") and nid(undefined). So this is false!

    • Ninox developper
    • Jacques_TUR
    • 1 yr ago
    • Reported - view
    Jim said:
    It would be helpful if there were some kind of query console built in to help debug these (for me, anyway) endless problems with basic data selection.

     

    There is the console that allows you to test bits of code.

    In addition, with the debugValueInfo function, you can have a little more information:

    debugValueInfo(select Weights) returns nest(["D1","D2",....])

      • Jim.5
      • 1 yr ago
      • Reported - view

      Jacques TUR Thanks for your reply. How do I get to the console? Thanks.

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Jim Here : 

      • Jim.5
      • 1 yr ago
      • Reported - view

      Jacques TUR Thank you!!!

Content aside

  • 1 yr agoLast active
  • 8Replies
  • 93Views
  • 5 Following