Is there a beast mode I can use to add two columns and then get the average?

Best Answers

  • david_cunningham
    Answer βœ“

    @kim_barragan0126

    If it’s always just the 2 columns, and you will have nulls. You could do

    (col1+col2)/2
    

    David Cunningham

    ** Was this post helpful? Click Agree πŸ˜€, Like πŸ‘οΈ, or Awesome ❀️ below **
    ** Did this solve your problem? Accept it as a solution! βœ”οΈ**

  • Sean_Tully
    Sean_Tully Contributor
    edited May 14 Answer βœ“

    Maybe something like:

    sum(ifnull(`R-Phone Interview`, 0) + ifnull(`R-Virtual Interview`, 0))/(count(`R-Phone Interview`) + count(R-Virtual Interview))

  • ArborRose
    ArborRose Coach
    Answer βœ“

    As mentioned, it's just (col1+col2)/2. Use coalesce(col1,0) if you have nulls. They will become zero.

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

Answers

  • david_cunningham
    Answer βœ“

    @kim_barragan0126

    If it’s always just the 2 columns, and you will have nulls. You could do

    (col1+col2)/2
    

    David Cunningham

    ** Was this post helpful? Click Agree πŸ˜€, Like πŸ‘οΈ, or Awesome ❀️ below **
    ** Did this solve your problem? Accept it as a solution! βœ”οΈ**

  • Sean_Tully
    Sean_Tully Contributor
    edited May 14 Answer βœ“

    Maybe something like:

    sum(ifnull(`R-Phone Interview`, 0) + ifnull(`R-Virtual Interview`, 0))/(count(`R-Phone Interview`) + count(R-Virtual Interview))

  • ArborRose
    ArborRose Coach
    Answer βœ“

    As mentioned, it's just (col1+col2)/2. Use coalesce(col1,0) if you have nulls. They will become zero.

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **

  • Thank you all!