Forum Discussion

DavidBrogdon's avatar
DavidBrogdon
Qrew Assistant Captain
7 years ago

How to calculate 'MODE' of child records?

I am curious if there is a way to write a formula that will calculate the Mode of the child records' specific field value. 

For example, if I have 5 apartments and 2 have the same rent. If I wanted to get the most occuring rent value from apartments back up to the parent building.. ?

Thanks for any help.
  • You would need to hope Dan Dielbolt sees this question as it will need a  non native solution.
    • DavidBrogdon's avatar
      DavidBrogdon
      Qrew Assistant Captain
      Yes, I sure hope he does. I mean, I can program the formula itself, logically. I just don't know how to interface it with QB to pull the values of the child records into an array. 

      Still though, I would have to account for multiple modes (bi-modal?) within my programming. 

      Hmm. Hope Dan has some insight. 
  • I am very short time so follow with questions if you wish:



    Honey Are You In The Mode Tonight? ~ List All Parents
    https://haversineconsulting.quickbase.com/db/bpaurgqmp?a=td

    Pastie Database
    https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=718

    Notes:

    (1) Despite the mode being commonly reported as a number it is in fact a categorical measure not a numeric measure. To this point check out the Geek parent record

    (2) I did not consider the case of multiple modes but that is easy to implement once you decide how you want to report a case with multiple modes.

    If you need further assistance with this problem free to contact me off-world using the information in my profile:

    https://getsatisfaction.com/people/dandiebolt