changeset 5392:014dc3219bdb extented-report

Made DQR template more bullet-proof for missing data.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sat, 03 Jul 2021 01:04:37 +0200
parents 1dd63a2405bc
children fe3f651bb03d
files report-templates/data-quality-report.yaml
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/report-templates/data-quality-report.yaml	Sat Jul 03 00:43:25 2021 +0200
+++ b/report-templates/data-quality-report.yaml	Sat Jul 03 01:04:37 2021 +0200
@@ -29,7 +29,7 @@
         destination: A{{ last_row }}
     - type: copy
       location: [A7]
-      destination: A{{ last_row + 1 }}
+      destination: A{{ (last_row ?? 6) + 1 }}
     # Gen Months
     - type: select
       statement: >
@@ -53,17 +53,17 @@
             ORDER BY objnam;
         actions:
         - type: assign
-          name: last_row 
+          name: last_row
           expr: (row_number ?? 0) + 6
         - type: copy
           location: [B6,C6]
           destination: '{{ coord2cell(column_number, last_row) }}'
       - type: copy
         location: [B7,C7]
-        destination: '{{ coord2cell(column_number, last_row + 1) }}'
+        destination: '{{ coord2cell(column_number, (last_row ?? 0) + 1) }}'
     - type: assign
       name: offset
-      expr: last_row + 3
+      expr: (last_row ?? 0) + 3
     #--------------------------------------------------------------------------
     # GAUGES
     # Header:
@@ -84,7 +84,7 @@
         destination: A{{ last_row }}
     - type: copy
       location: [A11]
-      destination: A{{ last_row + 1 }}
+      destination: A{{ (last_row ?? 10) + 1 }}
     # Gen Months
     - type: select
       statement: >
@@ -108,12 +108,12 @@
             ORDER BY objname;
         actions:
         - type: assign
-          name: last_row 
+          name: last_row
           expr: (row_number ?? 0) + offset + 1
         - type: copy
           location: [B10]
           destination: '{{ coord2cell(column_number, last_row) }}'
       - type: copy
         location: [B11]
-        destination: '{{ coord2cell(column_number, last_row + 1) }}'
+        destination: '{{ coord2cell(column_number, (last_row ?? 10) + 1) }}'