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.

8replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Only one line:

    max((select Weights).CalcValue)

    Like 1
      • Jim
      • Jim.5
      • 2 mths ago
      • Reported - view

      RoSoft_Steven It was literally just the parens needed!

      Working now.

      Thanks very much. :)

      Like
    • Fred
    • Fred
    • 2 mths 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.

    Like 1
  • 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!

    Like 2
  • 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",....])

    Like 1
      • Jim
      • Jim.5
      • 2 mths ago
      • Reported - view

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

      Like
    • Jim Here : 

      Like 1
      • Jim
      • Jim.5
      • 2 mths ago
      • Reported - view

      Jacques TUR Thank you!!!

      Like
Like Follow
  • 2 mths agoLast active
  • 8Replies
  • 56Views
  • 5 Following