Author Topic: Simple question - averaging/median numeric value attached to A or B  (Read 540 times)

Offline nestea

  • Associate
  • **
  • Posts: 3
  • Forum Citizenship: +0/-0
Greetings All,

So glad there's a forum for this software...
Got a simple question about syntax. I have:

CASE [Type of Player] WHEN 'Forward' or WHEN 'Defense'
THEN (median ([Points]))
END

I'd like to take an average/median of the points that correspond to either a forward or defense player. I know the above is improper syntax and was looking for the solution...

Thanks in advance.

Offline colt

  • Full Member
  • ***
  • Posts: 21
  • Forum Citizenship: +1/-0
there are 2 possible solutions:
1.
CASE [Type of Player]
WHEN 'Forward'
THEN (median([Points]))
WHEN 'Defense'
THEN (median([Points]))
END

2.
CASE WHEN [Type of Player]='Forward' OR [Type of Player]='Defense'
THEN (median([Points]))
END

hope this is what you expect.