![](https://secure.gravatar.com/avatar/f174b9816ccce31bf5cdb49501b15358.jpg?s=120&d=mm&r=g)
Hello I would like to make an automatic sum (see: variable "daystotadm") of a series of variables (see: variable "daysadm1-2..."), but if only one of these variable is empty, the automatic calculation using the function SUM give a null result. Do anyone know a way to solve this problem without the need to enter a value for each variable. In my file I don not necessarily enter all the five lines and the number of days is already a calculated field? I attach the qes and the check files Thank you Francesco Grandesso
QES FILE ---------------------------------------------------------------------------------
Date of entry Date of exit Number of days -------------------------------------------- --------------- {dateentry1} <dd/mm/yyyy> {dateexit1} <dd/mm/yyyy> {daysadm1} ### {dateentry2} <dd/mm/yyyy> {dateexit2} <dd/mm/yyyy> {daysadm2} ### {dateentry3} <dd/mm/yyyy> {dateexit3} <dd/mm/yyyy> {daysadm3} ### {dateentry4} <dd/mm/yyyy> {dateexit4} <dd/mm/yyyy> {daysadm4} ### {dateentry5} <dd/mm/yyyy> {dateexit5} <dd/mm/yyyy> {daysadm5} ### -------------------------------------------- --------------- {daystotadm} Total days ####
CHK FILE ----------------------------------------------------------------------------------
dateexit1 AFTER ENTRY daysadm1=(dateexit1-dateentry1) daystotadm=SUM(daysadm1,daysadm2,daysadm3,daysadm4,daysadm5) END END
daysadm1 NOENTER END
.................... and so on for each of the five dateexit* and daysadm* variables
__________________________________________ Francesco Grandesso EPICENTRE 8, Rue Saint Sabin 75011 Paris, France tel +33 (0)1 4021 2847 fax +33 (0)1 4021 2803 email Francesco.GRANDESSO@epicentre.msf.org