I would like to count the number of days in a month if the each day's data is > 0. I'm using this formula:
whileprintingrecords;
numbervar countdays;
if Sum ({@Pax01}) > 0 then
countdays:= count ({@Pax01},{RPT_TRIPS.Schedule ID})
else if Sum ({@Pax02}) > 0 then
countdays:= count ({@Pax02},{RPT_TRIPS.Schedule ID})
else if Sum ({@Pax03}) > 0 then
countdays:= count ({@Pax03},{RPT_TRIPS.Schedule ID})
else if Sum ({@Pax04}) > 0 then
countdays:= count ({@Pax04},{RPT_TRIPS.Schedule ID})
else if Sum ({@Pax05}) > 0 then
countdays:= count ({@Pax05},{RPT_TRIPS.Schedule ID})
... and so on all the way down to ({@Pax31}) for passenger counts up to 31 days.
It works fine for 1 route (a,b,c,d,e....) if i added route b so the parameter is selecting for route a & b, the days is not calculating correctly.
whileprintingrecords;
numbervar countdays;
if Sum ({@Pax01}) > 0 then
countdays:= count ({@Pax01},{RPT_TRIPS.Schedule ID})
else if Sum ({@Pax02}) > 0 then
countdays:= count ({@Pax02},{RPT_TRIPS.Schedule ID})
else if Sum ({@Pax03}) > 0 then
countdays:= count ({@Pax03},{RPT_TRIPS.Schedule ID})
else if Sum ({@Pax04}) > 0 then
countdays:= count ({@Pax04},{RPT_TRIPS.Schedule ID})
else if Sum ({@Pax05}) > 0 then
countdays:= count ({@Pax05},{RPT_TRIPS.Schedule ID})
... and so on all the way down to ({@Pax31}) for passenger counts up to 31 days.
It works fine for 1 route (a,b,c,d,e....) if i added route b so the parameter is selecting for route a & b, the days is not calculating correctly.