0

Median value

Greetings, is the median function available for use? I was unable to find it in the manual. Thanks.

2 replies

null
    • Jorg
    • 5 yrs ago
    • Reported - view

    Hi Laura, 

    To get the median you have to use a formula like this: 

     

    let mynumber := ((select 'My table') order by Number).Number;
    let mycnt := cnt(mynumber);
    let mymedian := if even(mycnt) then
    (item(mynumber, mycnt / 2) + item(mynumber, mycnt / 2 + 1)) / 2
    else
    item(mynumber, mycnt / 2)
    end;
    mymedian

     

    Best, Jörg

    • Laura
    • 5 yrs ago
    • Reported - view

    Sweet! Thanks, Jörg; that’s a huge help.

Content aside

  • 5 yrs agoLast active
  • 2Replies
  • 1626Views