Sum Function in Roster

Other discussions about CSPro
Forum rules
New release: CSPro 8.0
Post Reply
Phyo Ma
Posts: 3
Joined: November 5th, 2019, 4:40 am

Sum Function in Roster

Post by Phyo Ma »

How to use sum function in roster where there is a blank value
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Sum Function in Roster

Post 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.
Post Reply