Page 1 of 1

Sum Function in Roster

Posted: November 5th, 2019, 4:55 am
by Phyo Ma
How to use sum function in roster where there is a blank value

Re: Sum Function in Roster

Posted: November 5th, 2019, 6:00 am
by josh
The sum function already ignores blank values in a roster. From the help on sum:
If the value of an occurrence of the item is a special value (DEFAULT, MISSING,or NOTAPPL) the occurrence will not be included in the calculation. If none of the occurrences have values other than special values, DEFAULT is returned.
So the only case you have to handle is if all the values in the roster are blank in which case same will return default. To handle that you can just use an if statement to check if the sum is equal to default and use zero instead.