- for (my $i = 1; $i < $dataPoints; ++$i) {
- $dayCons .= "prev${mode}${i},";
- $consFunc .= ",${mode}";
+ if ($mode ne 'AVG') {
+ for (my $i = 1; $i < $dataPoints; ++$i) {
+ $dayCons .= "prev${mode}${i},";
+ $consFunc .= ",${mode}";
+ }
+ } else {
+ for (my $i = 1; $i < $dataPoints; ++$i) {
+ $dayCons .= "prev${mode}${i},";
+ }
+ $consFunc = ",${dataPoints},${mode}";