Sum Function in Roster

Other discussions about CSPro
Post Reply
Phyo Ma
Posts: 1
Joined: November 5th, 2019, 4:40 am

Sum Function in Roster

Post by Phyo Ma » November 5th, 2019, 4:55 am

How to use sum function in roster where there is a blank value

Posts: 1978
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Sum Function in Roster

Post by josh » November 5th, 2019, 6:00 am

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.

Post Reply