I need help in the Syntax of this

then I guess the only way would be to write 3 functions each time returning one of the values
do you think it is ok this way