diff --git a/results-tabulation-api/constants/AUTH_CONSTANTS.py b/results-tabulation-api/constants/AUTH_CONSTANTS.py index 584f3476..0b828c9d 100644 --- a/results-tabulation-api/constants/AUTH_CONSTANTS.py +++ b/results-tabulation-api/constants/AUTH_CONSTANTS.py @@ -12,7 +12,7 @@ ADMINISTRATIVE_DISTRICT_REPORT_VIEWER_ROLE = "adm_dis_rep_view" ADMINISTRATIVE_DISTRICT_REPORT_VERIFIER_ROLE = "adm_dis_rep_verf" PROVINCIAL_REPORT_VIEWER_ROLE = "prov_rep_view" -PROVINCIAL_REPORT_VERIFIER_ROLE = "prov_dis_rep_verf" +PROVINCIAL_REPORT_VERIFIER_ROLE = "prov_rep_verf" NATIONAL_REPORT_VIEWER_ROLE = "nat_dis_rep_view" NATIONAL_REPORT_VERIFIER_ROLE = "nat_dis_rep_verf" EC_LEADERSHIP_ROLE = "ec_leadership" diff --git a/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-administrative-district-counting.json b/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-administrative-district-counting.json index 4a7e6e83..0993d85c 100644 --- a/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-administrative-district-counting.json +++ b/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-administrative-district-counting.json @@ -15,8 +15,8 @@ "editable": true, "gnetId": null, "graphTooltip": 0, - "id": 45, - "iteration": 1596623250599, + "id": 55, + "iteration": 1615984216492, "links": [], "panels": [ { @@ -62,7 +62,7 @@ "nullText": null, "postfix": "", "postfixFontSize": "50%", - "prefix": "ELECTORAL DISTRICT COUNTING DASHBOARD", + "prefix": "PROVINCIAL COUNTING DASHBOARD - ", "prefixFontSize": "100%", "rangeMaps": [ { @@ -86,7 +86,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT GROUP_CONCAT(areaName) FROM area WHERE areaId IN ($electoralDistrictIds)", + "rawSql": "SELECT GROUP_CONCAT(areaName) FROM area WHERE areaId IN ($provinceIds)", "refId": "A", "select": [ [ @@ -166,7 +166,7 @@ "x": 0, "y": 4 }, - "id": 13, + "id": 79, "interval": null, "links": [], "mappingType": 1, @@ -186,7 +186,7 @@ "postfix": "", "postfixFontSize": "50%", "prefix": "", - "prefixFontSize": "70%", + "prefixFontSize": "30%", "rangeMaps": [ { "from": "null", @@ -213,7 +213,7 @@ "valueMaps": [ { "op": "=", - "text": "PE-27", + "text": "PCE-35", "value": "null" } ], @@ -244,7 +244,7 @@ "x": 4, "y": 4 }, - "id": 18, + "id": 38, "interval": null, "links": [], "mappingType": 1, @@ -261,9 +261,10 @@ "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, + "pluginVersion": "6.7.3", "postfix": "", "postfixFontSize": "50%", - "prefix": "PD", + "prefix": "AD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -274,9 +275,9 @@ ], "sparkline": { "fillColor": "#FADE2A", - "full": false, + "full": true, "lineColor": "rgb(31, 120, 193)", - "show": false, + "show": true, "ymax": null, "ymin": null }, @@ -287,7 +288,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.provinceId IN ($provinceIds)\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -352,7 +353,7 @@ "x": 9, "y": 4 }, - "id": 92, + "id": 18, "interval": null, "links": [], "mappingType": 1, @@ -371,7 +372,7 @@ "nullText": null, "postfix": "", "postfixFontSize": "50%", - "prefix": "PV PD", + "prefix": "PD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -395,7 +396,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.provinceId IN ($provinceIds)\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n\n\n-- SELECT\n-- CONCAT(\n-- SUM(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedTallySheetCount), \"/\", COUNT(*), \" - \",\n-- ROUND(SUM(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedTallySheetCount) * 100 / COUNT(*), 0), \"%\"\n-- ) AS \"\"\n-- FROM\n-- (SELECT\n-- SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedTallySheetCount\n-- FROM\n-- ext_pce2021_dashboard_tally_sheet_status\n-- WHERE\n-- ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n-- and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n-- and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n-- and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\n-- GROUP BY\n-- ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -460,7 +461,7 @@ "x": 14, "y": 4 }, - "id": 93, + "id": 8, "interval": null, "links": [], "mappingType": 1, @@ -479,7 +480,7 @@ "nullText": null, "postfix": "", "postfixFontSize": "50%", - "prefix": "DV PD", + "prefix": "PV PD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -503,7 +504,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n and ext_pce2021_dashboard_tally_sheet_status.provinceId IN ($provinceIds)\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -544,61 +545,74 @@ "valueName": "current" }, { + "cacheTimeout": null, + "colorBackground": false, + "colorPrefix": false, + "colorValue": true, + "colors": [ + "#73BF69", + "#73BF69", + "#73BF69" + ], "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, "gridPos": { "h": 1, "w": 5, "x": 19, "y": 4 }, - "id": 98, - "options": { - "displayMode": "lcd", - "fieldOptions": { - "calcs": [ - "mean" - ], - "defaults": { - "links": [], - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "orange", - "value": 20 - }, - { - "color": "#EAB839", - "value": 50 - }, - { - "color": "green", - "value": 80 - } - ] - } - }, - "overrides": [], - "values": false + "id": 107, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 }, - "orientation": "horizontal", - "showUnfilled": true + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "DV PD", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "#FADE2A", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false, + "ymax": null, + "ymin": null }, - "pluginVersion": "6.7.3", + "tableColumn": "", "targets": [ { "format": "table", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n ROUND(SUM(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections) * 100 / SUM(totalSections), 0) AS value\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -622,11 +636,21 @@ ] } ], + "thresholds": "", "timeFrom": null, "timeShift": null, "title": "", "transparent": true, - "type": "bargauge" + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" }, { "cacheTimeout": null, @@ -650,10 +674,10 @@ "gridPos": { "h": 1, "w": 5, - "x": 4, + "x": 9, "y": 5 }, - "id": 8, + "id": 109, "interval": null, "links": [], "mappingType": 1, @@ -696,7 +720,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.countingCentreId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.provinceId IN ($provinceIds)\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.countingCentreId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n\n\n-- SELECT\n-- CONCAT(\n-- SUM(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedTallySheetCount), \"/\", COUNT(*), \" - \",\n-- ROUND(SUM(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedTallySheetCount) * 100 / COUNT(*), 0), \"%\"\n-- ) AS \"\"\n-- FROM\n-- (SELECT\n-- SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedTallySheetCount\n-- FROM\n-- ext_pce2021_dashboard_tally_sheet_status\n-- WHERE\n-- ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n-- and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n-- and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n-- and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\n-- GROUP BY\n-- ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -758,10 +782,10 @@ "gridPos": { "h": 1, "w": 5, - "x": 9, + "x": 14, "y": 5 }, - "id": 28, + "id": 110, "interval": null, "links": [], "mappingType": 1, @@ -804,7 +828,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.countingCentreId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.countingCentreId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n\n\n-- SELECT\n-- CONCAT(\n-- SUM(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedTallySheetCount), \"/\", COUNT(*), \" - \",\n-- ROUND(SUM(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedTallySheetCount) * 100 / COUNT(*), 0), \"%\"\n-- ) AS \"\"\n-- FROM\n-- (SELECT\n-- SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedTallySheetCount\n-- FROM\n-- ext_pce2021_dashboard_tally_sheet_status\n-- WHERE\n-- ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n-- and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n-- and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n-- and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\n-- GROUP BY\n-- ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -866,10 +890,10 @@ "gridPos": { "h": 1, "w": 5, - "x": 14, + "x": 19, "y": 5 }, - "id": 53, + "id": 111, "interval": null, "links": [], "mappingType": 1, @@ -912,7 +936,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"CE-201-PV\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.countingCentreId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.countingCentreId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n\n\n-- SELECT\n-- CONCAT(\n-- SUM(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedTallySheetCount), \"/\", COUNT(*), \" - \",\n-- ROUND(SUM(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedTallySheetCount) * 100 / COUNT(*), 0), \"%\"\n-- ) AS \"\"\n-- FROM\n-- (SELECT\n-- SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedTallySheetCount\n-- FROM\n-- ext_pce2021_dashboard_tally_sheet_status\n-- WHERE\n-- ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n-- and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n-- and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n-- and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\n-- GROUP BY\n-- ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -992,7 +1016,7 @@ "x": 0, "y": 7 }, - "id": 14, + "id": 80, "interval": null, "links": [], "mappingType": 1, @@ -1012,7 +1036,7 @@ "postfix": "", "postfixFontSize": "50%", "prefix": "", - "prefixFontSize": "50%", + "prefixFontSize": "30%", "rangeMaps": [ { "from": "null", @@ -1043,7 +1067,7 @@ "value": "null" } ], - "valueName": "avg" + "valueName": "current" }, { "cacheTimeout": null, @@ -1070,7 +1094,7 @@ "x": 4, "y": 7 }, - "id": 19, + "id": 39, "interval": null, "links": [], "mappingType": 1, @@ -1089,7 +1113,7 @@ "nullText": null, "postfix": "", "postfixFontSize": "50%", - "prefix": "PD", + "prefix": "AD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -1113,7 +1137,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"CE-201\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"CE-201\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -1178,7 +1202,7 @@ "x": 9, "y": 7 }, - "id": 94, + "id": 19, "interval": null, "links": [], "mappingType": 1, @@ -1221,7 +1245,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"CE-201-PV\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"CE-201\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -1286,7 +1310,7 @@ "x": 14, "y": 7 }, - "id": 95, + "id": 9, "interval": null, "links": [], "mappingType": 1, @@ -1305,7 +1329,7 @@ "nullText": null, "postfix": "", "postfixFontSize": "50%", - "prefix": "PD", + "prefix": "PV PD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -1329,7 +1353,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"CE-201-PV\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"CE-201-PV\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -1370,60 +1394,74 @@ "valueName": "current" }, { + "cacheTimeout": null, + "colorBackground": false, + "colorPrefix": false, + "colorValue": true, + "colors": [ + "#73BF69", + "#73BF69", + "#73BF69" + ], "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, "gridPos": { "h": 1, "w": 5, "x": 19, "y": 7 }, - "id": 99, - "options": { - "displayMode": "lcd", - "fieldOptions": { - "calcs": [ - "mean" - ], - "defaults": { - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "orange", - "value": 20 - }, - { - "color": "#EAB839", - "value": 50 - }, - { - "color": "green", - "value": 80 - } - ] - } - }, - "overrides": [], - "values": false + "id": 108, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 }, - "orientation": "horizontal", - "showUnfilled": true + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "DV PD", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "#FADE2A", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false, + "ymax": null, + "ymin": null }, - "pluginVersion": "6.7.3", + "tableColumn": "", "targets": [ { "format": "table", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n ROUND(SUM(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections) * 100 / SUM(totalSections), 0) AS value\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName IN (\"CE-201\", \"CE-201-PV\")\n) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"CE-201-PV\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -1447,11 +1485,21 @@ ] } ], + "thresholds": "", "timeFrom": null, "timeShift": null, "title": "", "transparent": true, - "type": "bargauge" + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" }, { "cacheTimeout": null, @@ -1475,10 +1523,10 @@ "gridPos": { "h": 1, "w": 5, - "x": 4, + "x": 9, "y": 8 }, - "id": 9, + "id": 112, "interval": null, "links": [], "mappingType": 1, @@ -1521,7 +1569,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"CE-201\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.countingCentreId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"CE-201\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.countingCentreId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -1583,10 +1631,10 @@ "gridPos": { "h": 1, "w": 5, - "x": 9, + "x": 14, "y": 8 }, - "id": 30, + "id": 113, "interval": null, "links": [], "mappingType": 1, @@ -1629,7 +1677,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"CE-201-PV\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.countingCentreId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"CE-201-PV\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.countingCentreId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -1691,10 +1739,10 @@ "gridPos": { "h": 1, "w": 5, - "x": 14, + "x": 19, "y": 8 }, - "id": 48, + "id": 114, "interval": null, "links": [], "mappingType": 1, @@ -1737,7 +1785,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.countingCentreId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"CE-201-PV\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.countingCentreId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -1817,7 +1865,7 @@ "x": 0, "y": 10 }, - "id": 79, + "id": 81, "interval": null, "links": [], "mappingType": 1, @@ -1837,7 +1885,7 @@ "postfix": "", "postfixFontSize": "50%", "prefix": "", - "prefixFontSize": "50%", + "prefixFontSize": "30%", "rangeMaps": [ { "from": "null", @@ -1854,36 +1902,6 @@ "ymin": null }, "tableColumn": "", - "targets": [ - { - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n createdAt AS \"time\",\n statusReportId\nFROM dashboard_status_report\nWHERE\n $__timeFilter(createdAt)\nORDER BY createdAt", - "refId": "A", - "select": [ - [ - { - "params": [ - "statusReportId" - ], - "type": "column" - } - ] - ], - "table": "dashboard_status_report", - "timeColumn": "createdAt", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], "thresholds": "", "timeFrom": null, "timeShift": null, @@ -1894,11 +1912,11 @@ "valueMaps": [ { "op": "=", - "text": "PE-CE-RO-V1", + "text": "PCE-CE-RO-V1", "value": "null" } ], - "valueName": "avg" + "valueName": "current" }, { "cacheTimeout": null, @@ -1925,7 +1943,7 @@ "x": 4, "y": 10 }, - "id": 80, + "id": 85, "interval": null, "links": [], "mappingType": 1, @@ -1944,7 +1962,7 @@ "nullText": null, "postfix": "", "postfixFontSize": "50%", - "prefix": "PD", + "prefix": "AD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -1968,7 +1986,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-V1\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V1\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -2033,7 +2051,7 @@ "x": 9, "y": 10 }, - "id": 81, + "id": 84, "interval": null, "links": [], "mappingType": 1, @@ -2052,7 +2070,7 @@ "nullText": null, "postfix": "", "postfixFontSize": "50%", - "prefix": "PV PD", + "prefix": "PD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -2076,7 +2094,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-V1\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V1\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -2141,7 +2159,7 @@ "x": 14, "y": 10 }, - "id": 82, + "id": 86, "interval": null, "links": [], "mappingType": 1, @@ -2160,7 +2178,7 @@ "nullText": null, "postfix": "", "postfixFontSize": "50%", - "prefix": "DV PD", + "prefix": "PV PD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -2184,7 +2202,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-V1\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V1\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -2225,137 +2243,38 @@ "valueName": "current" }, { + "cacheTimeout": null, + "colorBackground": false, + "colorPrefix": false, + "colorValue": true, + "colors": [ + "#73BF69", + "#73BF69", + "#73BF69" + ], "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, "gridPos": { "h": 1, "w": 5, "x": 19, "y": 10 }, - "id": 100, - "options": { - "displayMode": "lcd", - "fieldOptions": { - "calcs": [ - "mean" - ], - "defaults": { - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "orange", - "value": 20 - }, - { - "color": "#EAB839", - "value": 50 - }, - { - "color": "green", - "value": 80 - } - ] - } - }, - "overrides": [], - "values": false - }, - "orientation": "horizontal", - "showUnfilled": true - }, - "pluginVersion": "6.7.3", - "targets": [ - { - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n ROUND(SUM(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections) * 100 / SUM(totalSections), 0) AS value\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-V1\"\n) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", - "refId": "A", - "select": [ - [ - { - "params": [ - "statusReportId" - ], - "type": "column" - } - ] - ], - "table": "dashboard_status_report", - "timeColumn": "createdAt", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "", - "transparent": true, - "type": "bargauge" - }, - { - "content": "", - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 11 - }, - "id": 78, - "mode": "markdown", - "timeFrom": null, - "timeShift": null, - "title": "", - "type": "text" - }, - { - "cacheTimeout": null, - "colorBackground": false, - "colorValue": false, - "colors": [ - "#299c46", - "rgba(237, 129, 40, 0.89)", - "#d44a3a" - ], - "datasource": null, - "format": "none", - "gauge": { - "maxValue": 100, - "minValue": 0, - "show": false, - "thresholdLabels": false, - "thresholdMarkers": true - }, - "gridPos": { - "h": 1, - "w": 4, - "x": 0, - "y": 12 - }, - "id": 77, - "interval": null, - "links": [], - "mappingType": 1, - "mappingTypes": [ - { - "name": "value to text", - "value": 1 + "id": 115, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 }, { "name": "range to text", @@ -2367,7 +2286,7 @@ "nullText": null, "postfix": "", "postfixFontSize": "50%", - "prefix": "", + "prefix": "PV PD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -2377,7 +2296,7 @@ } ], "sparkline": { - "fillColor": "rgba(31, 118, 189, 0.18)", + "fillColor": "#FADE2A", "full": false, "lineColor": "rgb(31, 120, 193)", "show": false, @@ -2387,11 +2306,11 @@ "tableColumn": "", "targets": [ { - "format": "time_series", + "format": "table", "group": [], "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n createdAt AS \"time\",\n statusReportId\nFROM dashboard_status_report\nWHERE\n $__timeFilter(createdAt)\nORDER BY createdAt", + "rawQuery": true, + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V1\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -2421,15 +2340,15 @@ "title": "", "transparent": true, "type": "singlestat", - "valueFontSize": "70%", + "valueFontSize": "50%", "valueMaps": [ { "op": "=", - "text": "PE-4", + "text": "N/A", "value": "null" } ], - "valueName": "avg" + "valueName": "current" }, { "cacheTimeout": null, @@ -2453,10 +2372,10 @@ "gridPos": { "h": 1, "w": 5, - "x": 4, - "y": 12 + "x": 9, + "y": 11 }, - "id": 21, + "id": 93, "interval": null, "links": [], "mappingType": 1, @@ -2473,10 +2392,9 @@ "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, - "pluginVersion": "6.7.3", "postfix": "", "postfixFontSize": "50%", - "prefix": "Parties", + "prefix": "RELEASED", "prefixFontSize": "50%", "rangeMaps": [ { @@ -2500,7 +2418,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-4\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.partyId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V1\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId,\n ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -2562,10 +2480,10 @@ "gridPos": { "h": 1, "w": 5, - "x": 9, - "y": 12 + "x": 14, + "y": 11 }, - "id": 34, + "id": 116, "interval": null, "links": [], "mappingType": 1, @@ -2582,10 +2500,9 @@ "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, - "pluginVersion": "6.7.3", "postfix": "", "postfixFontSize": "50%", - "prefix": "PV Parties", + "prefix": "RELEASED", "prefixFontSize": "50%", "rangeMaps": [ { @@ -2609,7 +2526,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-4\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.partyId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V1\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId,\n ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -2671,10 +2588,10 @@ "gridPos": { "h": 1, "w": 5, - "x": 14, - "y": 12 + "x": 19, + "y": 11 }, - "id": 66, + "id": 117, "interval": null, "links": [], "mappingType": 1, @@ -2691,10 +2608,9 @@ "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, - "pluginVersion": "6.7.3", "postfix": "", "postfixFontSize": "50%", - "prefix": "DV Parties", + "prefix": "RELEASED", "prefixFontSize": "50%", "rangeMaps": [ { @@ -2718,7 +2634,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-4\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.partyId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V1\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId,\n ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -2758,90 +2674,6 @@ ], "valueName": "current" }, - { - "datasource": null, - "gridPos": { - "h": 1, - "w": 5, - "x": 19, - "y": 12 - }, - "id": 101, - "options": { - "displayMode": "lcd", - "fieldOptions": { - "calcs": [ - "mean" - ], - "defaults": { - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "orange", - "value": 20 - }, - { - "color": "#EAB839", - "value": 50 - }, - { - "color": "green", - "value": 80 - } - ] - } - }, - "overrides": [], - "values": false - }, - "orientation": "horizontal", - "showUnfilled": true - }, - "pluginVersion": "6.7.3", - "targets": [ - { - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n ROUND(SUM(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections) * 100 / SUM(totalSections), 0) AS value\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-4\"\n) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", - "refId": "A", - "select": [ - [ - { - "params": [ - "statusReportId" - ], - "type": "column" - } - ] - ], - "table": "dashboard_status_report", - "timeColumn": "createdAt", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "", - "transparent": true, - "type": "bargauge" - }, { "content": "", "datasource": null, @@ -2849,9 +2681,9 @@ "h": 1, "w": 24, "x": 0, - "y": 13 + "y": 12 }, - "id": 76, + "id": 75, "mode": "markdown", "timeFrom": null, "timeShift": null, @@ -2880,9 +2712,9 @@ "h": 1, "w": 4, "x": 0, - "y": 14 + "y": 13 }, - "id": 83, + "id": 15, "interval": null, "links": [], "mappingType": 1, @@ -2902,7 +2734,7 @@ "postfix": "", "postfixFontSize": "50%", "prefix": "", - "prefixFontSize": "50%", + "prefixFontSize": "30%", "rangeMaps": [ { "from": "null", @@ -2919,36 +2751,6 @@ "ymin": null }, "tableColumn": "", - "targets": [ - { - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n createdAt AS \"time\",\n statusReportId\nFROM dashboard_status_report\nWHERE\n $__timeFilter(createdAt)\nORDER BY createdAt", - "refId": "A", - "select": [ - [ - { - "params": [ - "statusReportId" - ], - "type": "column" - } - ] - ], - "table": "dashboard_status_report", - "timeColumn": "createdAt", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], "thresholds": "", "timeFrom": null, "timeShift": null, @@ -2959,11 +2761,11 @@ "valueMaps": [ { "op": "=", - "text": "PE-CE-RO-PR-1", + "text": "PCE-4", "value": "null" } ], - "valueName": "avg" + "valueName": "current" }, { "cacheTimeout": null, @@ -2988,9 +2790,9 @@ "h": 1, "w": 5, "x": 4, - "y": 14 + "y": 13 }, - "id": 84, + "id": 66, "interval": null, "links": [], "mappingType": 1, @@ -3010,7 +2812,7 @@ "pluginVersion": "6.7.3", "postfix": "", "postfixFontSize": "50%", - "prefix": "Parties", + "prefix": "parties", "prefixFontSize": "50%", "rangeMaps": [ { @@ -3034,7 +2836,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-PR-1\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.partyId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n\n\n\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-4\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.partyId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -3074,15 +2876,47 @@ ], "valueName": "current" }, + { + "content": "", + "datasource": null, + "gridPos": { + "h": 2, + "w": 14, + "x": 10, + "y": 13 + }, + "id": 106, + "mode": "markdown", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "text" + }, + { + "content": "", + "datasource": null, + "gridPos": { + "h": 1, + "w": 9, + "x": 0, + "y": 14 + }, + "id": 83, + "mode": "markdown", + "timeFrom": null, + "timeShift": null, + "title": "", + "type": "text" + }, { "cacheTimeout": null, "colorBackground": false, - "colorPrefix": false, - "colorValue": true, + "colorValue": false, "colors": [ - "#73BF69", - "#73BF69", - "#73BF69" + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" ], "datasource": null, "format": "none", @@ -3095,11 +2929,11 @@ }, "gridPos": { "h": 1, - "w": 5, - "x": 9, - "y": 14 + "w": 4, + "x": 0, + "y": 15 }, - "id": 85, + "id": 97, "interval": null, "links": [], "mappingType": 1, @@ -3116,11 +2950,10 @@ "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, - "pluginVersion": "6.7.3", "postfix": "", "postfixFontSize": "50%", - "prefix": "PV Parties", - "prefixFontSize": "50%", + "prefix": "", + "prefixFontSize": "30%", "rangeMaps": [ { "from": "null", @@ -3129,7 +2962,7 @@ } ], "sparkline": { - "fillColor": "#FADE2A", + "fillColor": "rgba(31, 118, 189, 0.18)", "full": false, "lineColor": "rgb(31, 120, 193)", "show": false, @@ -3137,24 +2970,614 @@ "ymin": null }, "tableColumn": "", - "targets": [ + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "70%", + "valueMaps": [ { - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-PR-1\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.partyId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", - "refId": "A", - "select": [ - [ - { - "params": [ - "statusReportId" - ], - "type": "column" - } - ] - ], + "op": "=", + "text": "PCE-CE-RO-PR-1", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorPrefix": false, + "colorValue": true, + "colors": [ + "#73BF69", + "#73BF69", + "#73BF69" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 1, + "w": 5, + "x": 4, + "y": 15 + }, + "id": 98, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "pluginVersion": "6.7.3", + "postfix": "", + "postfixFontSize": "50%", + "prefix": "parties", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "#FADE2A", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false, + "ymax": null, + "ymin": null + }, + "tableColumn": "", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-PR-1\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.partyId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 1, + "w": 4, + "x": 10, + "y": 15 + }, + "id": 88, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "30%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false, + "ymax": null, + "ymin": null + }, + "tableColumn": "", + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "70%", + "valueMaps": [ + { + "op": "=", + "text": "PCE-CE-RO-V2", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorPrefix": false, + "colorValue": true, + "colors": [ + "#73BF69", + "#73BF69", + "#73BF69" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 1, + "w": 5, + "x": 14, + "y": 15 + }, + "id": 82, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "AD", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "#FADE2A", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false, + "ymax": null, + "ymin": null + }, + "tableColumn": "", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V2\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorPrefix": false, + "colorValue": true, + "colors": [ + "#73BF69", + "#73BF69", + "#73BF69" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 1, + "w": 5, + "x": 19, + "y": 15 + }, + "id": 95, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "RELEASED", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "#FADE2A", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false, + "ymax": null, + "ymin": null + }, + "tableColumn": "", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V2\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "content": "", + "datasource": null, + "gridPos": { + "h": 1, + "w": 9, + "x": 0, + "y": 16 + }, + "id": 76, + "mode": "markdown", + "timeFrom": null, + "timeShift": null, + "title": "", + "type": "text" + }, + { + "content": "", + "datasource": null, + "gridPos": { + "h": 1, + "w": 14, + "x": 10, + "y": 16 + }, + "id": 103, + "mode": "markdown", + "timeFrom": null, + "timeShift": null, + "title": "", + "type": "text" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 1, + "w": 4, + "x": 0, + "y": 17 + }, + "id": 99, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "30%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false, + "ymax": null, + "ymin": null + }, + "tableColumn": "", + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "70%", + "valueMaps": [ + { + "op": "=", + "text": "PCE-CE-RO-PR-2", + "value": "null" + } + ], + "valueName": "current" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorPrefix": false, + "colorValue": true, + "colors": [ + "#73BF69", + "#73BF69", + "#73BF69" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 1, + "w": 5, + "x": 4, + "y": 17 + }, + "id": 101, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "pluginVersion": "6.7.3", + "postfix": "", + "postfixFontSize": "50%", + "prefix": "parties", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "#FADE2A", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false, + "ymax": null, + "ymin": null + }, + "tableColumn": "", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-PR-2\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.partyId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], "table": "dashboard_status_report", "timeColumn": "createdAt", "timeColumnType": "timestamp", @@ -3183,6 +3606,83 @@ ], "valueName": "current" }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 1, + "w": 4, + "x": 10, + "y": 17 + }, + "id": 78, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "", + "prefixFontSize": "30%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false, + "ymax": null, + "ymin": null + }, + "tableColumn": "", + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "70%", + "valueMaps": [ + { + "op": "=", + "text": "PCE-R2", + "value": "null" + } + ], + "valueName": "current" + }, { "cacheTimeout": null, "colorBackground": false, @@ -3206,9 +3706,9 @@ "h": 1, "w": 5, "x": 14, - "y": 14 + "y": 17 }, - "id": 86, + "id": 92, "interval": null, "links": [], "mappingType": 1, @@ -3225,10 +3725,9 @@ "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, - "pluginVersion": "6.7.3", "postfix": "", "postfixFontSize": "50%", - "prefix": "DV Parties", + "prefix": "AD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -3252,7 +3751,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-PR-1\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.partyId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-R2\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -3293,60 +3792,74 @@ "valueName": "current" }, { + "cacheTimeout": null, + "colorBackground": false, + "colorPrefix": false, + "colorValue": true, + "colors": [ + "#73BF69", + "#73BF69", + "#73BF69" + ], "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, "gridPos": { "h": 1, "w": 5, "x": 19, - "y": 14 + "y": 17 }, - "id": 102, - "options": { - "displayMode": "lcd", - "fieldOptions": { - "calcs": [ - "mean" - ], - "defaults": { - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "orange", - "value": 20 - }, - { - "color": "#EAB839", - "value": 50 - }, - { - "color": "green", - "value": 80 - } - ] - } - }, - "overrides": [], - "values": false + "id": 96, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 }, - "orientation": "horizontal", - "showUnfilled": true + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "RELEASED", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "#FADE2A", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false, + "ymax": null, + "ymin": null }, - "pluginVersion": "6.7.3", + "tableColumn": "", "targets": [ { "format": "table", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n ROUND(SUM(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections) * 100 / SUM(totalSections), 0) AS value\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-PR-1\"\n) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-R2\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -3370,22 +3883,48 @@ ] } ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "content": "", + "datasource": null, + "gridPos": { + "h": 1, + "w": 9, + "x": 0, + "y": 18 + }, + "id": 90, + "mode": "markdown", "timeFrom": null, "timeShift": null, "title": "", - "transparent": true, - "type": "bargauge" + "type": "text" }, { "content": "", "datasource": null, "gridPos": { "h": 1, - "w": 24, - "x": 0, - "y": 15 + "w": 14, + "x": 10, + "y": 18 }, - "id": 75, + "id": 104, "mode": "markdown", "timeFrom": null, "timeShift": null, @@ -3414,9 +3953,9 @@ "h": 1, "w": 4, "x": 0, - "y": 16 + "y": 19 }, - "id": 87, + "id": 100, "interval": null, "links": [], "mappingType": 1, @@ -3436,7 +3975,7 @@ "postfix": "", "postfixFontSize": "50%", "prefix": "", - "prefixFontSize": "50%", + "prefixFontSize": "30%", "rangeMaps": [ { "from": "null", @@ -3453,36 +3992,6 @@ "ymin": null }, "tableColumn": "", - "targets": [ - { - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n createdAt AS \"time\",\n statusReportId\nFROM dashboard_status_report\nWHERE\n $__timeFilter(createdAt)\nORDER BY createdAt", - "refId": "A", - "select": [ - [ - { - "params": [ - "statusReportId" - ], - "type": "column" - } - ] - ], - "table": "dashboard_status_report", - "timeColumn": "createdAt", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], "thresholds": "", "timeFrom": null, "timeShift": null, @@ -3493,11 +4002,11 @@ "valueMaps": [ { "op": "=", - "text": "PE-CE-RO-PR-2", + "text": "PCE-CE-RO-PR-3", "value": "null" } ], - "valueName": "avg" + "valueName": "current" }, { "cacheTimeout": null, @@ -3522,9 +4031,9 @@ "h": 1, "w": 5, "x": 4, - "y": 16 + "y": 19 }, - "id": 88, + "id": 102, "interval": null, "links": [], "mappingType": 1, @@ -3544,7 +4053,7 @@ "pluginVersion": "6.7.3", "postfix": "", "postfixFontSize": "50%", - "prefix": "Parties", + "prefix": "parties", "prefixFontSize": "50%", "rangeMaps": [ { @@ -3568,7 +4077,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-PR-2\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.partyId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n\n\n\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-PR-3\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.partyId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -3608,106 +4117,6 @@ ], "valueName": "current" }, - { - "datasource": null, - "gridPos": { - "h": 1, - "w": 5, - "x": 19, - "y": 16 - }, - "id": 103, - "options": { - "displayMode": "lcd", - "fieldOptions": { - "calcs": [ - "mean" - ], - "defaults": { - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "orange", - "value": 20 - }, - { - "color": "#EAB839", - "value": 50 - }, - { - "color": "green", - "value": 80 - } - ] - } - }, - "overrides": [], - "values": false - }, - "orientation": "horizontal", - "showUnfilled": true - }, - "pluginVersion": "6.7.3", - "targets": [ - { - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n ROUND(SUM(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections) * 100 / SUM(totalSections), 0) AS value\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-PR-2\"\n) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", - "refId": "A", - "select": [ - [ - { - "params": [ - "statusReportId" - ], - "type": "column" - } - ] - ], - "table": "dashboard_status_report", - "timeColumn": "createdAt", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "", - "transparent": true, - "type": "bargauge" - }, - { - "content": "", - "datasource": null, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 17 - }, - "id": 89, - "mode": "markdown", - "timeFrom": null, - "timeShift": null, - "title": "", - "type": "text" - }, { "cacheTimeout": null, "colorBackground": false, @@ -3729,10 +4138,10 @@ "gridPos": { "h": 1, "w": 4, - "x": 0, - "y": 18 + "x": 10, + "y": 19 }, - "id": 90, + "id": 87, "interval": null, "links": [], "mappingType": 1, @@ -3752,7 +4161,7 @@ "postfix": "", "postfixFontSize": "50%", "prefix": "", - "prefixFontSize": "50%", + "prefixFontSize": "30%", "rangeMaps": [ { "from": "null", @@ -3769,36 +4178,6 @@ "ymin": null }, "tableColumn": "", - "targets": [ - { - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n createdAt AS \"time\",\n statusReportId\nFROM dashboard_status_report\nWHERE\n $__timeFilter(createdAt)\nORDER BY createdAt", - "refId": "A", - "select": [ - [ - { - "params": [ - "statusReportId" - ], - "type": "column" - } - ] - ], - "table": "dashboard_status_report", - "timeColumn": "createdAt", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], "thresholds": "", "timeFrom": null, "timeShift": null, @@ -3809,11 +4188,11 @@ "valueMaps": [ { "op": "=", - "text": "PE-CE-RO-PR-2", + "text": "PCE-21", "value": "null" } ], - "valueName": "avg" + "valueName": "current" }, { "cacheTimeout": null, @@ -3837,8 +4216,8 @@ "gridPos": { "h": 1, "w": 5, - "x": 4, - "y": 18 + "x": 14, + "y": 19 }, "id": 91, "interval": null, @@ -3857,10 +4236,9 @@ "maxDataPoints": 100, "nullPointMode": "connected", "nullText": null, - "pluginVersion": "6.7.3", "postfix": "", "postfixFontSize": "50%", - "prefix": "Parties", + "prefix": "AD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -3884,7 +4262,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-PR-3\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.partyId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n\n\n\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-21\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -3925,60 +4303,74 @@ "valueName": "current" }, { + "cacheTimeout": null, + "colorBackground": false, + "colorPrefix": false, + "colorValue": true, + "colors": [ + "#73BF69", + "#73BF69", + "#73BF69" + ], "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, "gridPos": { "h": 1, "w": 5, "x": 19, - "y": 18 + "y": 19 }, - "id": 104, - "options": { - "displayMode": "lcd", - "fieldOptions": { - "calcs": [ - "mean" - ], - "defaults": { - "mappings": [], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "orange", - "value": 20 - }, - { - "color": "#EAB839", - "value": 50 - }, - { - "color": "green", - "value": 80 - } - ] - } - }, - "overrides": [], - "values": false + "id": 94, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 }, - "orientation": "horizontal", - "showUnfilled": true + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "RELEASED", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "#FADE2A", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false, + "ymax": null, + "ymin": null }, - "pluginVersion": "6.7.3", + "tableColumn": "", "targets": [ { "format": "table", "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n ROUND(SUM(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections) * 100 / SUM(totalSections), 0) AS value\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-PR-3\"\n) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-21\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -4002,11 +4394,53 @@ ] } ], + "thresholds": "", "timeFrom": null, "timeShift": null, "title": "", "transparent": true, - "type": "bargauge" + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "current" + }, + { + "content": "", + "datasource": null, + "gridPos": { + "h": 1, + "w": 9, + "x": 0, + "y": 20 + }, + "id": 89, + "mode": "markdown", + "timeFrom": null, + "timeShift": null, + "title": "", + "type": "text" + }, + { + "content": "", + "datasource": null, + "gridPos": { + "h": 1, + "w": 14, + "x": 10, + "y": 20 + }, + "id": 105, + "mode": "markdown", + "timeFrom": null, + "timeShift": null, + "title": "", + "type": "text" } ], "refresh": "5m", @@ -4018,11 +4452,12 @@ { "allValue": null, "current": { - "text": "307 - PE 2020 - All Island Test 2", - "value": "307" + "tags": [], + "text": "406 - UVA Provincial Council Election 2021 - Test 1", + "value": "406" }, "datasource": "MySQL", - "definition": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PARLIAMENT_ELECTION_2020' and parentElectionId IS NULL;", + "definition": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PROVINCIAL_COUNCIL_ELECTION_2021' and parentElectionId IS NULL;", "hide": 0, "includeAll": false, "index": -1, @@ -4030,7 +4465,7 @@ "multi": false, "name": "rootElectionId", "options": [], - "query": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PARLIAMENT_ELECTION_2020' and parentElectionId IS NULL;", + "query": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PROVINCIAL_COUNCIL_ELECTION_2021' and parentElectionId IS NULL;", "refresh": 1, "regex": "", "skipUrlSync": false, @@ -4044,132 +4479,20 @@ { "allValue": null, "current": { - "tags": [], - "text": "13 - Digamadulla", - "value": "115499" + "text": "Uva", + "value": "67993" }, "datasource": "MySQL", - "definition": "SELECT \n areaName AS __text, areaId AS __value \nFROM area, election \nWHERE \n election.electionId = area.electionId and election.rootElectionId = $rootElectionId and areaType = 'ElectoralDistrict';", + "definition": "SELECT \n areaName AS __text, areaId AS __value \nFROM area, election \nWHERE \n election.electionId = area.electionId and election.rootElectionId = $rootElectionId and areaType = 'Province';", "hide": 0, "includeAll": false, "index": -1, - "label": null, + "label": "Province", "multi": false, - "name": "electoralDistrictIds", - "options": [ - { - "selected": false, - "text": "01 - Colombo", - "value": "98479" - }, - { - "selected": false, - "text": "02 - Gampaha", - "value": "101115" - }, - { - "selected": false, - "text": "03 - Kalutara", - "value": "103795" - }, - { - "selected": false, - "text": "04 - Kandy", - "value": "105255" - }, - { - "selected": false, - "text": "05 - Matale", - "value": "107140" - }, - { - "selected": false, - "text": "06 - NuwaraEliya", - "value": "107862" - }, - { - "selected": false, - "text": "07 - Galle", - "value": "108949" - }, - { - "selected": false, - "text": "08 - Matara", - "value": "110520" - }, - { - "selected": false, - "text": "09 - Hambantota", - "value": "111576" - }, - { - "selected": false, - "text": "10 - Jaffna", - "value": "112490" - }, - { - "selected": true, - "text": "11 - Vanni", - "value": "113820" - }, - { - "selected": false, - "text": "12 - Batticaloa", - "value": "114578" - }, - { - "selected": false, - "text": "13 - Digamadulla", - "value": "115499" - }, - { - "selected": false, - "text": "14 - Trincomalee", - "value": "116606" - }, - { - "selected": false, - "text": "15 - Kurunegala", - "value": "117260" - }, - { - "selected": false, - "text": "16 - Puttalam", - "value": "119355" - }, - { - "selected": false, - "text": "17 - Anuradhapura", - "value": "120292" - }, - { - "selected": false, - "text": "18 - Polonnaruwa", - "value": "121664" - }, - { - "selected": false, - "text": "19 - Badulla", - "value": "122291" - }, - { - "selected": false, - "text": "20 - Monaragala", - "value": "123466" - }, - { - "selected": false, - "text": "21 - Ratnapura", - "value": "124296" - }, - { - "selected": false, - "text": "22 - Kegalle", - "value": "125692" - } - ], - "query": "SELECT \n areaName AS __text, areaId AS __value \nFROM area, election \nWHERE \n election.electionId = area.electionId and election.rootElectionId = $rootElectionId and areaType = 'ElectoralDistrict';", - "refresh": 0, + "name": "provinceIds", + "options": [], + "query": "SELECT \n areaName AS __text, areaId AS __value \nFROM area, election \nWHERE \n election.electionId = area.electionId and election.rootElectionId = $rootElectionId and areaType = 'Province';", + "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, @@ -4200,10 +4523,10 @@ ] }, "timezone": "", - "title": "Parliament Election 2020 - Counting - Electoral District", - "uid": "TUq9Vx7Mz", + "title": "Provincial Council Election 2021 - Counting - Provincial", + "uid": "GXrbHAVMkz", "variables": { "list": [] }, - "version": 6 + "version": 20 } \ No newline at end of file diff --git a/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-administrative-district-results.json b/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-administrative-district-results.json index 8f22fdde..e35da671 100644 --- a/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-administrative-district-results.json +++ b/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-administrative-district-results.json @@ -15,8 +15,8 @@ "editable": true, "gnetId": null, "graphTooltip": 0, - "id": 46, - "iteration": 1596657503874, + "id": 54, + "iteration": 1615981784521, "links": [], "panels": [ { @@ -62,7 +62,7 @@ "nullText": null, "postfix": "", "postfixFontSize": "50%", - "prefix": "ELECTORAL DISTRICT RESULTS DASHBOARD", + "prefix": "ADMINISTRATIVE DISTRICT RESULTS DASHBOARD", "prefixFontSize": "70%", "rangeMaps": [ { @@ -86,7 +86,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT GROUP_CONCAT(area.areaName) FROM area WHERE areaId IN ($electoralDistrictIds)", + "rawSql": "SELECT GROUP_CONCAT(area.areaName) FROM area WHERE areaId IN ($administrativeDistrictIds)", "refId": "A", "select": [ [ @@ -170,7 +170,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n NOW() as \"time\", party.partyName as \"name\", COALESCE(SUM(ext_pe2020_dashboard_party_wise_vote_results.voteCount), 0) AS aggregatedVoteCount\nFROM\n ext_pe2020_dashboard_party_wise_vote_results, party\nWHERE \n party.partyId = ext_pe2020_dashboard_party_wise_vote_results.partyId\n and ext_pe2020_dashboard_party_wise_vote_results.electionId = $rootElectionId\n and ext_pe2020_dashboard_party_wise_vote_results.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_party_wise_vote_results.incrementId IN (\n SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\nGROUP BY\n ext_pe2020_dashboard_party_wise_vote_results.partyId\nORDER BY\n aggregatedVoteCount DESC,\n ext_pe2020_dashboard_party_wise_vote_results.partyId;\n\n", + "rawSql": "SELECT\n NOW() as \"time\", party.partyName as \"name\", COALESCE(SUM(ext_pce2021_dashboard_party_wise_vote_results.voteCount), 0) AS aggregatedVoteCount\nFROM\n ext_pce2021_dashboard_party_wise_vote_results, party\nWHERE \n party.partyId = ext_pce2021_dashboard_party_wise_vote_results.partyId\n and ext_pce2021_dashboard_party_wise_vote_results.electionId = $rootElectionId\n and ext_pce2021_dashboard_party_wise_vote_results.administrativeDistrictId IN ($administrativeDistrictIds)\n and ext_pce2021_dashboard_party_wise_vote_results.incrementId IN (\n SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\nGROUP BY\n ext_pce2021_dashboard_party_wise_vote_results.partyId\nORDER BY\n aggregatedVoteCount DESC,\n ext_pce2021_dashboard_party_wise_vote_results.partyId;\n\n", "refId": "A", "select": [ [ @@ -244,7 +244,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n NOW() as \"time\", party.partyName AS \"name\", \n COALESCE(SUM(ext_pe2020_dashboard_party_wise_seat_allocation.seatCount), 0) AS aggregatedSeatCount\nFROM ext_pe2020_dashboard_party_wise_seat_allocation, party\nWHERE \n party.partyId = ext_pe2020_dashboard_party_wise_seat_allocation.partyId\n and ext_pe2020_dashboard_party_wise_seat_allocation.electionId = $rootElectionId\n and ext_pe2020_dashboard_party_wise_seat_allocation.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_party_wise_seat_allocation.incrementId IN (\n SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\nGROUP BY\n party.partyId\nORDER BY\n aggregatedSeatCount DESC, party.partyId\n", + "rawSql": "SELECT\n NOW() as \"time\", party.partyName AS \"name\", \n COALESCE(SUM(ext_pce2021_dashboard_party_wise_seat_allocation.seatCount), 0) AS aggregatedSeatCount\nFROM ext_pce2021_dashboard_party_wise_seat_allocation, party\nWHERE \n party.partyId = ext_pce2021_dashboard_party_wise_seat_allocation.partyId\n and ext_pce2021_dashboard_party_wise_seat_allocation.electionId = $rootElectionId\n and ext_pce2021_dashboard_party_wise_seat_allocation.administrativeDistrictId IN ($administrativeDistrictIds)\n and ext_pce2021_dashboard_party_wise_seat_allocation.incrementId IN (\n SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\nGROUP BY\n party.partyId\nORDER BY\n aggregatedSeatCount DESC, party.partyId\n", "refId": "A", "select": [ [ @@ -906,7 +906,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT \n COALESCE(SUM(areaMap.registeredPostalVotersCount), 0) AS \"\",\n COALESCE(SUM(areaMap.registeredDisplacedVotersCount), 0) AS \"\",\n COALESCE(SUM(areaMap.registeredVotersCount), 0) AS \"\",\n COALESCE(SUM(areaMap.registeredPostalVotersCount + areaMap.registeredVotersCount + areaMap.registeredDisplacedVotersCount), 0) AS \"\"\nFROM\n ext_pe2020_dashboard_area_map as areaMap\nWHERE \n areaMap.electionId = $rootElectionId\n and areaMap.electoralDistrictId IN ($electoralDistrictIds)\n\n\n", + "rawSql": "SELECT \n COALESCE(SUM(areaMap.registeredPostalVotersCount), 0) AS \"\",\n COALESCE(SUM(areaMap.registeredDisplacedVotersCount), 0) AS \"\",\n COALESCE(SUM(areaMap.registeredVotersCount), 0) AS \"\",\n COALESCE(SUM(areaMap.registeredPostalVotersCount + areaMap.registeredVotersCount + areaMap.registeredDisplacedVotersCount), 0) AS \"\"\nFROM\n ext_pce2021_dashboard_area_map as areaMap\nWHERE \n areaMap.electionId = $rootElectionId\n and areaMap.administrativeDistrictId IN ($administrativeDistrictIds)\n\n\n", "refId": "A", "select": [ [ @@ -978,7 +978,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"Postal\", ext_pe2020_dashboard_vote_results.voteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"Displaced\", ext_pe2020_dashboard_vote_results.voteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"NonPostal\", ext_pe2020_dashboard_vote_results.voteCount, 0)), 0) AS \"\",\n COALESCE(SUM(ext_pe2020_dashboard_vote_results.voteCount), 0) AS \"\"\nFROM\n ext_pe2020_dashboard_vote_results\nWHERE \n ext_pe2020_dashboard_vote_results.electionId = $rootElectionId\n and ext_pe2020_dashboard_vote_results.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_vote_results.incrementId IN (\n SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n\n", + "rawSql": "SELECT\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"Postal\", ext_pce2021_dashboard_vote_results.voteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"Displaced\", ext_pce2021_dashboard_vote_results.voteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"NonPostal\", ext_pce2021_dashboard_vote_results.voteCount, 0)), 0) AS \"\",\n COALESCE(SUM(ext_pce2021_dashboard_vote_results.voteCount), 0) AS \"\"\nFROM\n ext_pce2021_dashboard_vote_results\nWHERE \n ext_pce2021_dashboard_vote_results.electionId = $rootElectionId\n and ext_pce2021_dashboard_vote_results.administrativeDistrictId IN ($administrativeDistrictIds)\n and ext_pce2021_dashboard_vote_results.incrementId IN (\n SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n\n", "refId": "A", "select": [ [ @@ -1050,7 +1050,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"Postal\", ext_pe2020_dashboard_vote_results.validVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"Displaced\", ext_pe2020_dashboard_vote_results.validVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"NonPostal\", ext_pe2020_dashboard_vote_results.validVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(ext_pe2020_dashboard_vote_results.validVoteCount), 0) AS \"\"\nFROM\n ext_pe2020_dashboard_vote_results\nWHERE \n ext_pe2020_dashboard_vote_results.electionId = $rootElectionId\n and ext_pe2020_dashboard_vote_results.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_vote_results.incrementId IN (\n SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n\n", + "rawSql": "SELECT\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"Postal\", ext_pce2021_dashboard_vote_results.validVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"Displaced\", ext_pce2021_dashboard_vote_results.validVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"NonPostal\", ext_pce2021_dashboard_vote_results.validVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(ext_pce2021_dashboard_vote_results.validVoteCount), 0) AS \"\"\nFROM\n ext_pce2021_dashboard_vote_results\nWHERE \n ext_pce2021_dashboard_vote_results.electionId = $rootElectionId\n and ext_pce2021_dashboard_vote_results.administrativeDistrictId IN ($administrativeDistrictIds)\n and ext_pce2021_dashboard_vote_results.incrementId IN (\n SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n\n", "refId": "A", "select": [ [ @@ -1122,7 +1122,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"Postal\", ext_pe2020_dashboard_vote_results.rejectedVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"Displaced\", ext_pe2020_dashboard_vote_results.rejectedVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"NonPostal\", ext_pe2020_dashboard_vote_results.rejectedVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(ext_pe2020_dashboard_vote_results.rejectedVoteCount), 0) AS \"\"\nFROM\n ext_pe2020_dashboard_vote_results\nWHERE \n ext_pe2020_dashboard_vote_results.electionId = $rootElectionId\n and ext_pe2020_dashboard_vote_results.electoralDistrictId IN ($electoralDistrictIds)\n and ext_pe2020_dashboard_vote_results.incrementId IN (\n SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n\n", + "rawSql": "SELECT\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"Postal\", ext_pce2021_dashboard_vote_results.rejectedVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"Displaced\", ext_pce2021_dashboard_vote_results.rejectedVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"NonPostal\", ext_pce2021_dashboard_vote_results.rejectedVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(ext_pce2021_dashboard_vote_results.rejectedVoteCount), 0) AS \"\"\nFROM\n ext_pce2021_dashboard_vote_results\nWHERE \n ext_pce2021_dashboard_vote_results.electionId = $rootElectionId\n and ext_pce2021_dashboard_vote_results.administrativeDistrictId IN ($administrativeDistrictIds)\n and ext_pce2021_dashboard_vote_results.incrementId IN (\n SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n\n", "refId": "A", "select": [ [ @@ -1533,12 +1533,11 @@ { "allValue": null, "current": { - "tags": [], - "text": "307 - PE 2020 - All Island Test 2", - "value": "307" + "text": "386 - Provincial Council Election 2021 - Test 1", + "value": "386" }, "datasource": "MySQL", - "definition": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PARLIAMENT_ELECTION_2020' and parentElectionId IS NULL;", + "definition": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PROVINCIAL_COUNCIL_ELECTION_2021' and parentElectionId IS NULL;", "hide": 0, "includeAll": false, "index": -1, @@ -1546,7 +1545,7 @@ "multi": false, "name": "rootElectionId", "options": [], - "query": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PARLIAMENT_ELECTION_2020' and parentElectionId IS NULL;", + "query": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PROVINCIAL_COUNCIL_ELECTION_2021' and parentElectionId IS NULL;", "refresh": 1, "regex": "", "skipUrlSync": false, @@ -1565,126 +1564,21 @@ "value": "98479" }, "datasource": "MySQL", - "definition": "SELECT \n areaName AS __text, areaId AS __value \nFROM area, election \nWHERE \n election.electionId = area.electionId and election.rootElectionId = $rootElectionId and areaType = 'ElectoralDistrict';", + "definition": "SELECT \n areaName AS __text, areaId AS __value \nFROM area, election \nWHERE \n election.electionId = area.electionId and election.rootElectionId = $rootElectionId and areaType = 'AdministrativeDistrict';", "hide": 0, "includeAll": false, "index": -1, - "label": "Electoral District", + "label": "Administrative District", "multi": false, - "name": "electoralDistrictIds", + "name": "administrativeDistrictIds", "options": [ { "selected": true, "text": "01 - Colombo", - "value": "98479" - }, - { - "selected": false, - "text": "02 - Gampaha", - "value": "101115" - }, - { - "selected": false, - "text": "03 - Kalutara", - "value": "103795" - }, - { - "selected": false, - "text": "04 - Kandy", - "value": "105255" - }, - { - "selected": false, - "text": "05 - Matale", - "value": "107140" - }, - { - "selected": false, - "text": "06 - NuwaraEliya", - "value": "107862" - }, - { - "selected": false, - "text": "07 - Galle", - "value": "108949" - }, - { - "selected": false, - "text": "08 - Matara", - "value": "110520" - }, - { - "selected": false, - "text": "09 - Hambantota", - "value": "111576" - }, - { - "selected": false, - "text": "10 - Jaffna", - "value": "112490" - }, - { - "selected": false, - "text": "11 - Vanni", - "value": "113820" - }, - { - "selected": false, - "text": "12 - Batticaloa", - "value": "114578" - }, - { - "selected": false, - "text": "13 - Digamadulla", - "value": "115499" - }, - { - "selected": false, - "text": "14 - Trincomalee", - "value": "116606" - }, - { - "selected": false, - "text": "15 - Kurunegala", - "value": "117260" - }, - { - "selected": false, - "text": "16 - Puttalam", - "value": "119355" - }, - { - "selected": false, - "text": "17 - Anuradhapura", - "value": "120292" - }, - { - "selected": false, - "text": "18 - Polonnaruwa", - "value": "121664" - }, - { - "selected": false, - "text": "19 - Badulla", - "value": "122291" - }, - { - "selected": false, - "text": "20 - Monaragala", - "value": "123466" - }, - { - "selected": false, - "text": "21 - Ratnapura", - "value": "124296" - }, - { - "selected": false, - "text": "22 - Kegalle", - "value": "125692" + "value": "65917" } ], - "query": "SELECT \n areaName AS __text, areaId AS __value \nFROM area, election \nWHERE \n election.electionId = area.electionId and election.rootElectionId = $rootElectionId and areaType = 'ElectoralDistrict';", + "query": "SELECT \n areaName AS __text, areaId AS __value \nFROM area, election \nWHERE \n election.electionId = area.electionId and election.rootElectionId = $rootElectionId and areaType = 'AdministrativeDistrict';", "refresh": 0, "regex": "", "skipUrlSync": false, @@ -1716,10 +1610,10 @@ ] }, "timezone": "", - "title": "Parliament Election 2020 - Results - Electoral District", - "uid": "7W5oXmIMk", + "title": "Provincial Council Election 2021 - Results - Administrative District", + "uid": "5ThAYmQGz", "variables": { "list": [] }, - "version": 5 + "version": 12 } \ No newline at end of file diff --git a/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-provincial-counting.json b/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-provincial-counting.json index 4d20251b..7fbd596f 100644 --- a/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-provincial-counting.json +++ b/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-provincial-counting.json @@ -15,8 +15,8 @@ "editable": true, "gnetId": null, "graphTooltip": 0, - "id": 44, - "iteration": 1596623404308, + "id": 55, + "iteration": 1615979626464, "links": [], "panels": [ { @@ -62,7 +62,7 @@ "nullText": null, "postfix": "", "postfixFontSize": "50%", - "prefix": "ALL ISLAND COUNTING DASHBOARD", + "prefix": "PROVINCIAL COUNTING DASHBOARD - ", "prefixFontSize": "100%", "rangeMaps": [ { @@ -213,7 +213,7 @@ "valueMaps": [ { "op": "=", - "text": "PE-27", + "text": "PCE-35", "value": "null" } ], @@ -264,7 +264,7 @@ "pluginVersion": "6.7.3", "postfix": "", "postfixFontSize": "50%", - "prefix": "ED", + "prefix": "AD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -288,7 +288,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -396,7 +396,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n\n\n-- SELECT\n-- CONCAT(\n-- SUM(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedTallySheetCount), \"/\", COUNT(*), \" - \",\n-- ROUND(SUM(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedTallySheetCount) * 100 / COUNT(*), 0), \"%\"\n-- ) AS \"\"\n-- FROM\n-- (SELECT\n-- SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedTallySheetCount\n-- FROM\n-- ext_pe2020_dashboard_tally_sheet_status\n-- WHERE\n-- ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n-- and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n-- and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n-- and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\n-- GROUP BY\n-- ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n\n\n-- SELECT\n-- CONCAT(\n-- SUM(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedTallySheetCount), \"/\", COUNT(*), \" - \",\n-- ROUND(SUM(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedTallySheetCount) * 100 / COUNT(*), 0), \"%\"\n-- ) AS \"\"\n-- FROM\n-- (SELECT\n-- SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedTallySheetCount\n-- FROM\n-- ext_pce2021_dashboard_tally_sheet_status\n-- WHERE\n-- ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n-- and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n-- and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n-- and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\n-- GROUP BY\n-- ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -504,7 +504,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -612,7 +612,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -720,7 +720,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.countingCentreId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n\n\n-- SELECT\n-- CONCAT(\n-- SUM(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedTallySheetCount), \"/\", COUNT(*), \" - \",\n-- ROUND(SUM(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedTallySheetCount) * 100 / COUNT(*), 0), \"%\"\n-- ) AS \"\"\n-- FROM\n-- (SELECT\n-- SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedTallySheetCount\n-- FROM\n-- ext_pe2020_dashboard_tally_sheet_status\n-- WHERE\n-- ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n-- and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n-- and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n-- and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\n-- GROUP BY\n-- ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.countingCentreId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n\n\n-- SELECT\n-- CONCAT(\n-- SUM(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedTallySheetCount), \"/\", COUNT(*), \" - \",\n-- ROUND(SUM(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedTallySheetCount) * 100 / COUNT(*), 0), \"%\"\n-- ) AS \"\"\n-- FROM\n-- (SELECT\n-- SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedTallySheetCount\n-- FROM\n-- ext_pce2021_dashboard_tally_sheet_status\n-- WHERE\n-- ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n-- and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n-- and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n-- and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\n-- GROUP BY\n-- ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -828,7 +828,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.countingCentreId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n\n\n-- SELECT\n-- CONCAT(\n-- SUM(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedTallySheetCount), \"/\", COUNT(*), \" - \",\n-- ROUND(SUM(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedTallySheetCount) * 100 / COUNT(*), 0), \"%\"\n-- ) AS \"\"\n-- FROM\n-- (SELECT\n-- SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedTallySheetCount\n-- FROM\n-- ext_pe2020_dashboard_tally_sheet_status\n-- WHERE\n-- ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n-- and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n-- and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n-- and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\n-- GROUP BY\n-- ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.countingCentreId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n\n\n-- SELECT\n-- CONCAT(\n-- SUM(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedTallySheetCount), \"/\", COUNT(*), \" - \",\n-- ROUND(SUM(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedTallySheetCount) * 100 / COUNT(*), 0), \"%\"\n-- ) AS \"\"\n-- FROM\n-- (SELECT\n-- SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedTallySheetCount\n-- FROM\n-- ext_pce2021_dashboard_tally_sheet_status\n-- WHERE\n-- ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n-- and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n-- and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n-- and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\n-- GROUP BY\n-- ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -936,7 +936,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.countingCentreId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n\n\n-- SELECT\n-- CONCAT(\n-- SUM(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedTallySheetCount), \"/\", COUNT(*), \" - \",\n-- ROUND(SUM(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedTallySheetCount) * 100 / COUNT(*), 0), \"%\"\n-- ) AS \"\"\n-- FROM\n-- (SELECT\n-- SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedTallySheetCount\n-- FROM\n-- ext_pe2020_dashboard_tally_sheet_status\n-- WHERE\n-- ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n-- and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n-- and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-27\"\n-- and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\n-- GROUP BY\n-- ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.countingCentreId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n\n\n-- SELECT\n-- CONCAT(\n-- SUM(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedTallySheetCount), \"/\", COUNT(*), \" - \",\n-- ROUND(SUM(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedTallySheetCount) * 100 / COUNT(*), 0), \"%\"\n-- ) AS \"\"\n-- FROM\n-- (SELECT\n-- SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedTallySheetCount\n-- FROM\n-- ext_pce2021_dashboard_tally_sheet_status\n-- WHERE\n-- ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n-- and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n-- and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-35\"\n-- and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\n-- GROUP BY\n-- ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -1113,7 +1113,7 @@ "nullText": null, "postfix": "", "postfixFontSize": "50%", - "prefix": "ED", + "prefix": "AD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -1137,7 +1137,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"CE-201\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"CE-201\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -1245,7 +1245,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"CE-201\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"CE-201\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -1353,7 +1353,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"CE-201-PV\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"CE-201-PV\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -1461,7 +1461,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"CE-201-PV\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"CE-201-PV\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -1569,7 +1569,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"CE-201\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.countingCentreId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"CE-201\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.countingCentreId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -1677,7 +1677,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"CE-201-PV\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.countingCentreId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"CE-201-PV\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.countingCentreId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -1785,7 +1785,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"CE-201-PV\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.countingCentreId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"CE-201-PV\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.countingCentreId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -1912,7 +1912,7 @@ "valueMaps": [ { "op": "=", - "text": "PE-CE-RO-V1", + "text": "PCE-CE-RO-V1", "value": "null" } ], @@ -1962,7 +1962,7 @@ "nullText": null, "postfix": "", "postfixFontSize": "50%", - "prefix": "ED", + "prefix": "AD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -1986,7 +1986,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-V1\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V1\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -2094,7 +2094,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-V1\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V1\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -2202,7 +2202,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-V1\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V1\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -2310,7 +2310,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-V1\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V1\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -2418,7 +2418,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-V1\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId,\n ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V1\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"NonPostal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId,\n ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -2526,7 +2526,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-V1\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId,\n ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V1\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Postal\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId,\n ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -2634,7 +2634,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-V1\"\n and ext_pe2020_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId,\n ext_pe2020_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V1\"\n and ext_pce2021_dashboard_tally_sheet_status.voteType = \"Displaced\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId,\n ext_pce2021_dashboard_tally_sheet_status.pollingDivisionId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -2761,7 +2761,7 @@ "valueMaps": [ { "op": "=", - "text": "PE-4", + "text": "PCE-4", "value": "null" } ], @@ -2836,7 +2836,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-4\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.partyId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-4\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.partyId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -2980,7 +2980,7 @@ "valueMaps": [ { "op": "=", - "text": "PE-CE-RO-PR-1", + "text": "PCE-CE-RO-PR-1", "value": "null" } ], @@ -3055,7 +3055,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-PR-1\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.partyId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-PR-1\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.partyId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -3166,7 +3166,7 @@ "valueMaps": [ { "op": "=", - "text": "PE-CE-RO-V2", + "text": "PCE-CE-RO-V2", "value": "null" } ], @@ -3216,7 +3216,7 @@ "nullText": null, "postfix": "", "postfixFontSize": "50%", - "prefix": "ED", + "prefix": "AD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -3240,7 +3240,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-V2\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V2\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -3348,7 +3348,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-V2\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-V2\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -3491,7 +3491,7 @@ "valueMaps": [ { "op": "=", - "text": "PE-CE-RO-PR-2", + "text": "PCE-CE-RO-PR-2", "value": "null" } ], @@ -3566,7 +3566,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-PR-2\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.partyId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-PR-2\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.partyId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -3677,7 +3677,7 @@ "valueMaps": [ { "op": "=", - "text": "PE-R2", + "text": "PCE-R2", "value": "null" } ], @@ -3727,7 +3727,7 @@ "nullText": null, "postfix": "", "postfixFontSize": "50%", - "prefix": "ED", + "prefix": "AD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -3751,7 +3751,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-R2\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-R2\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -3859,7 +3859,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-R2\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-R2\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -4002,7 +4002,7 @@ "valueMaps": [ { "op": "=", - "text": "PE-CE-RO-PR-3", + "text": "PCE-CE-RO-PR-3", "value": "null" } ], @@ -4077,7 +4077,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-CE-RO-PR-3\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.partyId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-CE-RO-PR-3\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.partyId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -4188,7 +4188,7 @@ "valueMaps": [ { "op": "=", - "text": "PE-21", + "text": "PCE-21", "value": "null" } ], @@ -4238,7 +4238,7 @@ "nullText": null, "postfix": "", "postfixFontSize": "50%", - "prefix": "ED", + "prefix": "AD", "prefixFontSize": "50%", "rangeMaps": [ { @@ -4262,7 +4262,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-21\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(verifiedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-21\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -4370,7 +4370,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pe2020_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pe2020_dashboard_tally_sheet_status\nWHERE\n ext_pe2020_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n and ext_pe2020_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pe2020_dashboard_tally_sheet_status.templateName = \"PE-21\"\nGROUP BY\n ext_pe2020_dashboard_tally_sheet_status.electoralDistrictId) AS ext_pe2020_dashboard_tally_sheet_status_aggregated\n", + "rawSql": "SELECT\n CONCAT(\n SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)), \"/\", COUNT(*), \" - \",\n ROUND(SUM(IF(ext_pce2021_dashboard_tally_sheet_status_aggregated.completedSections = totalSections, 1, 0)) * 100 / COUNT(*), 0), \"%\"\n ) AS \"\"\nFROM\n(SELECT\n SUM(IF(releasedTallySheetCount = totalTallySheetCount, 1, 0)) AS completedSections, COUNT(*) AS totalSections\nFROM\n ext_pce2021_dashboard_tally_sheet_status\nWHERE\n ext_pce2021_dashboard_tally_sheet_status.incrementId IN (SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n and ext_pce2021_dashboard_tally_sheet_status.electionId = $rootElectionId\n and ext_pce2021_dashboard_tally_sheet_status.templateName = \"PCE-21\"\nGROUP BY\n ext_pce2021_dashboard_tally_sheet_status.administrativeDistrictId) AS ext_pce2021_dashboard_tally_sheet_status_aggregated\n", "refId": "A", "select": [ [ @@ -4452,11 +4452,11 @@ { "allValue": null, "current": { - "text": "307 - PE 2020 - All Island Test 2", - "value": "307" + "text": "386 - Provincial Council Election 2021 - Test 1", + "value": "386" }, "datasource": "MySQL", - "definition": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PARLIAMENT_ELECTION_2020' and parentElectionId IS NULL;", + "definition": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PROVINCIAL_COUNCIL_ELECTION_2021' and parentElectionId IS NULL;", "hide": 0, "includeAll": false, "index": -1, @@ -4464,7 +4464,7 @@ "multi": false, "name": "rootElectionId", "options": [], - "query": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PARLIAMENT_ELECTION_2020' and parentElectionId IS NULL;", + "query": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PROVINCIAL_COUNCIL_ELECTION_2021' and parentElectionId IS NULL;", "refresh": 1, "regex": "", "skipUrlSync": false, @@ -4496,8 +4496,8 @@ ] }, "timezone": "", - "title": "Parliament Election 2020 - Counting - All Island", - "uid": "GXrbHAVMk", + "title": "Provincial Council Election 2021 - Counting - Provincial", + "uid": "GXrbHAVMkz", "variables": { "list": [] }, diff --git a/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-provincial-results.json b/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-provincial-results.json index b467a5ee..032d0d6f 100644 --- a/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-provincial-results.json +++ b/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-provincial-results.json @@ -15,8 +15,8 @@ "editable": true, "gnetId": null, "graphTooltip": 0, - "id": 35, - "iteration": 1596658668941, + "id": 56, + "iteration": 1615980987350, "links": [], "panels": [ { @@ -170,7 +170,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n NOW() as \"time\", party.partyName AS \"name\", \n COALESCE(SUM(ext_pe2020_dashboard_party_wise_seat_allocation.seatCount), 0) AS aggregatedSeatCount\nFROM ext_pe2020_dashboard_party_wise_seat_allocation, party\nWHERE \n party.partyId = ext_pe2020_dashboard_party_wise_seat_allocation.partyId\n and ext_pe2020_dashboard_party_wise_seat_allocation.electionId = $rootElectionId\n and ext_pe2020_dashboard_party_wise_seat_allocation.incrementId IN (\n SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\nGROUP BY\n party.partyId\nORDER BY\n aggregatedSeatCount DESC, party.partyId\n", + "rawSql": "SELECT\n NOW() as \"time\", party.partyName AS \"name\", \n COALESCE(SUM(ext_pce2021_dashboard_party_wise_seat_allocation.seatCount), 0) AS aggregatedSeatCount\nFROM ext_pce2021_dashboard_party_wise_seat_allocation, party\nWHERE \n party.partyId = ext_pce2021_dashboard_party_wise_seat_allocation.partyId\n and ext_pce2021_dashboard_party_wise_seat_allocation.electionId = $rootElectionId\n and ext_pce2021_dashboard_party_wise_seat_allocation.incrementId IN (\n SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\nGROUP BY\n party.partyId\nORDER BY\n aggregatedSeatCount DESC, party.partyId\n", "refId": "A", "select": [ [ @@ -205,7 +205,7 @@ "datasource": null, "gridPos": { "h": 7, - "w": 12, + "w": 18, "x": 0, "y": 3 }, @@ -244,7 +244,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n NOW() as \"time\", party.partyName as \"name\", COALESCE(SUM(ext_pe2020_dashboard_party_wise_vote_results.voteCount), 0) AS aggregatedVoteCount\nFROM\n ext_pe2020_dashboard_party_wise_vote_results, party\nWHERE \n party.partyId = ext_pe2020_dashboard_party_wise_vote_results.partyId\n and ext_pe2020_dashboard_party_wise_vote_results.electionId = $rootElectionId\n and ext_pe2020_dashboard_party_wise_vote_results.incrementId IN (\n SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\nGROUP BY\n ext_pe2020_dashboard_party_wise_vote_results.partyId\nORDER BY\n aggregatedVoteCount DESC,\n ext_pe2020_dashboard_party_wise_vote_results.partyId;\n\n", + "rawSql": "SELECT\n NOW() as \"time\", party.partyName as \"name\", COALESCE(SUM(ext_pce2021_dashboard_party_wise_vote_results.voteCount), 0) AS aggregatedVoteCount\nFROM\n ext_pce2021_dashboard_party_wise_vote_results, party\nWHERE \n party.partyId = ext_pce2021_dashboard_party_wise_vote_results.partyId\n and ext_pce2021_dashboard_party_wise_vote_results.electionId = $rootElectionId\n and ext_pce2021_dashboard_party_wise_vote_results.incrementId IN (\n SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\nGROUP BY\n ext_pce2021_dashboard_party_wise_vote_results.partyId\nORDER BY\n aggregatedVoteCount DESC,\n ext_pce2021_dashboard_party_wise_vote_results.partyId;\n\n", "refId": "A", "select": [ [ @@ -274,80 +274,6 @@ "transparent": true, "type": "bargauge" }, - { - "cacheTimeout": null, - "datasource": null, - "gridPos": { - "h": 7, - "w": 6, - "x": 12, - "y": 3 - }, - "id": 44, - "links": [], - "options": { - "displayMode": "gradient", - "fieldOptions": { - "calcs": [ - "mean" - ], - "defaults": { - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "title": "$__cell_1" - }, - "limit": 10, - "overrides": [], - "values": true - }, - "orientation": "horizontal", - "showUnfilled": true - }, - "pluginVersion": "6.7.3", - "targets": [ - { - "format": "table", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n NOW() as \"time\", party.partyName AS \"name\", \n COALESCE(SUM(ext_pe2020_dashboard_party_wise_national_list_seat_allocation.nationalListSeatCount), 0) AS aggregatedSeatCount\nFROM ext_pe2020_dashboard_party_wise_national_list_seat_allocation, party\nWHERE \n party.partyId = ext_pe2020_dashboard_party_wise_national_list_seat_allocation.partyId\n and ext_pe2020_dashboard_party_wise_national_list_seat_allocation.electionId = $rootElectionId\n and ext_pe2020_dashboard_party_wise_national_list_seat_allocation.incrementId IN (\n SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\nGROUP BY\n party.partyId\nORDER BY\n aggregatedSeatCount DESC, party.partyId\n", - "refId": "A", - "select": [ - [ - { - "params": [ - "statusReportId" - ], - "type": "column" - } - ] - ], - "table": "dashboard_status_report", - "timeColumn": "createdAt", - "timeColumnType": "timestamp", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "timeFrom": null, - "timeShift": null, - "title": "National List", - "transparent": true, - "type": "bargauge" - }, { "cacheTimeout": null, "content": "", @@ -980,7 +906,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT \n COALESCE(SUM(areaMap.registeredPostalVotersCount), 0) AS \"\",\n COALESCE(SUM(areaMap.registeredDisplacedVotersCount), 0) AS \"\",\n COALESCE(SUM(areaMap.registeredVotersCount), 0) AS \"\",\n COALESCE(SUM(areaMap.registeredPostalVotersCount + areaMap.registeredVotersCount + areaMap.registeredDisplacedVotersCount), 0) AS \"\"\nFROM\n ext_pe2020_dashboard_area_map as areaMap\nWHERE \n areaMap.electionId = $rootElectionId\n\n\n", + "rawSql": "SELECT \n COALESCE(SUM(areaMap.registeredPostalVotersCount), 0) AS \"\",\n COALESCE(SUM(areaMap.registeredDisplacedVotersCount), 0) AS \"\",\n COALESCE(SUM(areaMap.registeredVotersCount), 0) AS \"\",\n COALESCE(SUM(areaMap.registeredPostalVotersCount + areaMap.registeredVotersCount + areaMap.registeredDisplacedVotersCount), 0) AS \"\"\nFROM\n ext_pce2021_dashboard_area_map as areaMap\nWHERE \n areaMap.electionId = $rootElectionId\n\n\n", "refId": "A", "select": [ [ @@ -1052,7 +978,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"Postal\", ext_pe2020_dashboard_vote_results.voteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"Displaced\", ext_pe2020_dashboard_vote_results.voteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"NonPostal\", ext_pe2020_dashboard_vote_results.voteCount, 0)), 0) AS \"\",\n COALESCE(SUM(ext_pe2020_dashboard_vote_results.voteCount), 0) AS \"\"\nFROM\n ext_pe2020_dashboard_vote_results\nWHERE \n ext_pe2020_dashboard_vote_results.electionId = $rootElectionId\n and ext_pe2020_dashboard_vote_results.incrementId IN (\n SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n\n", + "rawSql": "SELECT\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"Postal\", ext_pce2021_dashboard_vote_results.voteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"Displaced\", ext_pce2021_dashboard_vote_results.voteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"NonPostal\", ext_pce2021_dashboard_vote_results.voteCount, 0)), 0) AS \"\",\n COALESCE(SUM(ext_pce2021_dashboard_vote_results.voteCount), 0) AS \"\"\nFROM\n ext_pce2021_dashboard_vote_results\nWHERE \n ext_pce2021_dashboard_vote_results.electionId = $rootElectionId\n and ext_pce2021_dashboard_vote_results.incrementId IN (\n SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n\n", "refId": "A", "select": [ [ @@ -1124,7 +1050,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"Postal\", ext_pe2020_dashboard_vote_results.validVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"Displaced\", ext_pe2020_dashboard_vote_results.validVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"NonPostal\", ext_pe2020_dashboard_vote_results.validVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(ext_pe2020_dashboard_vote_results.validVoteCount), 0) AS \"\"\nFROM\n ext_pe2020_dashboard_vote_results\nWHERE \n ext_pe2020_dashboard_vote_results.electionId = $rootElectionId\n and ext_pe2020_dashboard_vote_results.incrementId IN (\n SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n\n", + "rawSql": "SELECT\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"Postal\", ext_pce2021_dashboard_vote_results.validVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"Displaced\", ext_pce2021_dashboard_vote_results.validVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"NonPostal\", ext_pce2021_dashboard_vote_results.validVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(ext_pce2021_dashboard_vote_results.validVoteCount), 0) AS \"\"\nFROM\n ext_pce2021_dashboard_vote_results\nWHERE \n ext_pce2021_dashboard_vote_results.electionId = $rootElectionId\n and ext_pce2021_dashboard_vote_results.incrementId IN (\n SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n\n", "refId": "A", "select": [ [ @@ -1196,7 +1122,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"Postal\", ext_pe2020_dashboard_vote_results.rejectedVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"Displaced\", ext_pe2020_dashboard_vote_results.rejectedVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pe2020_dashboard_vote_results.voteType = \"NonPostal\", ext_pe2020_dashboard_vote_results.rejectedVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(ext_pe2020_dashboard_vote_results.rejectedVoteCount), 0) AS \"\"\nFROM\n ext_pe2020_dashboard_vote_results\nWHERE \n ext_pe2020_dashboard_vote_results.electionId = $rootElectionId\n and ext_pe2020_dashboard_vote_results.incrementId IN (\n SELECT MAX(ext_pe2020_dashboard_increment.id) from ext_pe2020_dashboard_increment WHERE ext_pe2020_dashboard_increment.active=1)\n\n", + "rawSql": "SELECT\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"Postal\", ext_pce2021_dashboard_vote_results.rejectedVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"Displaced\", ext_pce2021_dashboard_vote_results.rejectedVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(IF(ext_pce2021_dashboard_vote_results.voteType = \"NonPostal\", ext_pce2021_dashboard_vote_results.rejectedVoteCount, 0)), 0) AS \"\",\n COALESCE(SUM(ext_pce2021_dashboard_vote_results.rejectedVoteCount), 0) AS \"\"\nFROM\n ext_pce2021_dashboard_vote_results\nWHERE \n ext_pce2021_dashboard_vote_results.electionId = $rootElectionId\n and ext_pce2021_dashboard_vote_results.incrementId IN (\n SELECT MAX(ext_pce2021_dashboard_increment.id) from ext_pce2021_dashboard_increment WHERE ext_pce2021_dashboard_increment.active=1)\n\n", "refId": "A", "select": [ [ @@ -1598,7 +1524,7 @@ "type": "text" } ], - "refresh": "5m", + "refresh": false, "schemaVersion": 22, "style": "dark", "tags": [], @@ -1607,12 +1533,12 @@ { "allValue": null, "current": { - "tags": [], - "text": "307 - PE 2020 - All Island Test 2", - "value": "307" + "selected": false, + "text": "406 - UVA Provincial Council Election 2021 - Test 1", + "value": "406" }, "datasource": "MySQL", - "definition": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PARLIAMENT_ELECTION_2020' and parentElectionId IS NULL;", + "definition": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PROVINCIAL_COUNCIL_ELECTION_2021' and parentElectionId IS NULL;", "hide": 0, "includeAll": false, "index": -1, @@ -1620,7 +1546,7 @@ "multi": false, "name": "rootElectionId", "options": [], - "query": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PARLIAMENT_ELECTION_2020' and parentElectionId IS NULL;", + "query": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PROVINCIAL_COUNCIL_ELECTION_2021' and parentElectionId IS NULL;", "refresh": 1, "regex": "", "skipUrlSync": false, @@ -1652,10 +1578,10 @@ ] }, "timezone": "", - "title": "Parliament Election 2020 - Results - All Island", - "uid": "YMS0mb7Gz", + "title": "Provincial Council Election 2021 - Results - Provincial", + "uid": "YMS0mb7GzF", "variables": { "list": [] }, - "version": 15 + "version": 5 } \ No newline at end of file diff --git a/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-status-tallysheet.json b/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-status-tallysheet.json new file mode 100644 index 00000000..964b1793 --- /dev/null +++ b/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-status-tallysheet.json @@ -0,0 +1,1326 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 47, + "iteration": 1615982929968, + "links": [], + "panels": [ + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": false, + "colors": [ + "#299c46", + "rgba(237, 129, 40, 0.89)", + "#d44a3a" + ], + "datasource": "MySQL", + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 21, + "x": 0, + "y": 0 + }, + "id": 19, + "interval": null, + "links": [], + "mappingType": 1, + "mappingTypes": [ + { + "name": "value to text", + "value": 1 + }, + { + "name": "range to text", + "value": 2 + } + ], + "maxDataPoints": 100, + "nullPointMode": "connected", + "nullText": null, + "postfix": "", + "postfixFontSize": "50%", + "prefix": "Administrative District", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "rgba(31, 118, 189, 0.18)", + "full": false, + "lineColor": "rgb(31, 120, 193)", + "show": false, + "ymax": null, + "ymin": null + }, + "tableColumn": "", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT GROUP_CONCAT(areaName) FROM area WHERE areaId IN ($administrativeDistrictIds)", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "100%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "first" + }, + { + "columns": [], + "datasource": null, + "fontSize": "100%", + "gridPos": { + "h": 19, + "w": 3, + "x": 0, + "y": 2 + }, + "id": 4, + "pageSize": null, + "showHeader": true, + "sort": { + "col": null, + "desc": false + }, + "styles": [ + { + "alias": "Time", + "align": "left", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "link": false, + "pattern": "Time", + "preserveFormat": true, + "sanitize": true, + "type": "string" + }, + { + "alias": "", + "align": "left", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "preserveFormat": true, + "sanitize": true, + "thresholds": [], + "type": "string", + "unit": "short" + } + ], + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT \n CONCAT(\n '
', tallySheetAreaLabel, '
', templateName, IF(voteType='Postal', ' (PV)', ''), '') \n AS \"\" \nFROM\n (\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countingCentreAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n CONCAT(countingCentreAreaMap.pollingDivisionName, \" / \", countingCentreAreaMap.countingCentreName) as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n areaMap.countingCentreId, areaMap.countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId,\n areaMap.countingCentreId\n ) as countingCentreAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countingCentreAreaMap.countingCentreId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, pollingDivisionAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n pollingDivisionAreaMap.pollingDivisionName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId\n ) as pollingDivisionAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = pollingDivisionAreaMap.pollingDivisionId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, administrativeDistrictAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n administrativeDistrictAreaMap.administrativeDistrictName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId\n ) as administrativeDistrictAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = administrativeDistrictAreaMap.administrativeDistrictId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countryAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n countryAreaMap.countryName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n NULL AS administrativeDistrictId, NULL AS administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId\n ) as countryAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countryAreaMap.countryId\n ) AS areaMappedTallySheet\nWHERE\n areaMappedTallySheet.rootElectionId = $rootElectionId\n and areaMappedTallySheet.administrativeDistrictId IN ($administrativeDistrictIds)\n and areaMappedTallySheet.status = 'Empty'\n\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "TODO", + "transform": "table", + "type": "table" + }, + { + "columns": [], + "datasource": null, + "fontSize": "100%", + "gridPos": { + "h": 19, + "w": 3, + "x": 3, + "y": 2 + }, + "id": 5, + "pageSize": null, + "showHeader": true, + "sort": { + "col": null, + "desc": false + }, + "styles": [ + { + "alias": "Time", + "align": "left", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "link": false, + "pattern": "Time", + "preserveFormat": true, + "sanitize": true, + "type": "string" + }, + { + "alias": "", + "align": "left", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "preserveFormat": true, + "sanitize": true, + "thresholds": [], + "type": "string", + "unit": "short" + } + ], + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT \n CONCAT(\n '
', tallySheetAreaLabel, '
', templateName, IF(voteType='Postal', ' (PV)', ''), '') \n AS \"\" \nFROM\n (\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countingCentreAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n CONCAT(countingCentreAreaMap.pollingDivisionName, \" / \", countingCentreAreaMap.countingCentreName) as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n areaMap.countingCentreId, areaMap.countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId,\n areaMap.countingCentreId\n ) as countingCentreAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countingCentreAreaMap.countingCentreId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, pollingDivisionAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n pollingDivisionAreaMap.pollingDivisionName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId\n ) as pollingDivisionAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = pollingDivisionAreaMap.pollingDivisionId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, administrativeDistrictAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n administrativeDistrictAreaMap.administrativeDistrictName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId\n ) as administrativeDistrictAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = administrativeDistrictAreaMap.administrativeDistrictId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countryAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n countryAreaMap.countryName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n NULL AS administrativeDistrictId, NULL AS administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId\n ) as countryAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countryAreaMap.countryId\n ) AS areaMappedTallySheet\nWHERE\n areaMappedTallySheet.rootElectionId = $rootElectionId\n and areaMappedTallySheet.administrativeDistrictId IN ($administrativeDistrictIds)\n and areaMappedTallySheet.status = 'Saved'\n\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "In Progress", + "transform": "table", + "type": "table" + }, + { + "columns": [], + "datasource": null, + "fontSize": "100%", + "gridPos": { + "h": 19, + "w": 3, + "x": 6, + "y": 2 + }, + "id": 6, + "pageSize": null, + "showHeader": true, + "sort": { + "col": null, + "desc": false + }, + "styles": [ + { + "alias": "Time", + "align": "left", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "link": false, + "pattern": "Time", + "preserveFormat": true, + "sanitize": true, + "type": "string" + }, + { + "alias": "", + "align": "left", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "preserveFormat": true, + "sanitize": true, + "thresholds": [], + "type": "string", + "unit": "short" + } + ], + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT \n CONCAT(\n '
', tallySheetAreaLabel, '
', templateName, IF(voteType='Postal', ' (PV)', ''), '') \n AS \"\" \nFROM\n (\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countingCentreAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n CONCAT(countingCentreAreaMap.pollingDivisionName, \" / \", countingCentreAreaMap.countingCentreName) as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n areaMap.countingCentreId, areaMap.countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId,\n areaMap.countingCentreId\n ) as countingCentreAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countingCentreAreaMap.countingCentreId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, pollingDivisionAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n pollingDivisionAreaMap.pollingDivisionName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId\n ) as pollingDivisionAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = pollingDivisionAreaMap.pollingDivisionId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, administrativeDistrictAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n administrativeDistrictAreaMap.administrativeDistrictName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId\n ) as administrativeDistrictAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = administrativeDistrictAreaMap.administrativeDistrictId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countryAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n countryAreaMap.countryName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n NULL AS administrativeDistrictId, NULL AS administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId\n ) as countryAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countryAreaMap.countryId\n ) AS areaMappedTallySheet\nWHERE\n areaMappedTallySheet.rootElectionId = $rootElectionId\n and areaMappedTallySheet.administrativeDistrictId IN ($administrativeDistrictIds)\n and areaMappedTallySheet.status = 'Submitted'\n\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Submitted", + "transform": "table", + "type": "table" + }, + { + "columns": [], + "datasource": null, + "fontSize": "100%", + "gridPos": { + "h": 19, + "w": 3, + "x": 9, + "y": 2 + }, + "id": 7, + "pageSize": null, + "showHeader": true, + "sort": { + "col": null, + "desc": false + }, + "styles": [ + { + "alias": "Time", + "align": "left", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "link": false, + "pattern": "Time", + "preserveFormat": true, + "sanitize": true, + "type": "string" + }, + { + "alias": "", + "align": "left", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "preserveFormat": true, + "sanitize": true, + "thresholds": [], + "type": "string", + "unit": "short" + } + ], + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT \n CONCAT(\n '
', tallySheetAreaLabel, '
', templateName, IF(voteType='Postal', ' (PV)', ''), '') \n AS \"\" \nFROM\n (\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countingCentreAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n CONCAT(countingCentreAreaMap.pollingDivisionName, \" / \", countingCentreAreaMap.countingCentreName) as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n areaMap.countingCentreId, areaMap.countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId,\n areaMap.countingCentreId\n ) as countingCentreAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countingCentreAreaMap.countingCentreId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, pollingDivisionAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n pollingDivisionAreaMap.pollingDivisionName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId\n ) as pollingDivisionAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = pollingDivisionAreaMap.pollingDivisionId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, administrativeDistrictAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n administrativeDistrictAreaMap.administrativeDistrictName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId\n ) as administrativeDistrictAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = administrativeDistrictAreaMap.administrativeDistrictId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countryAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n countryAreaMap.countryName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n NULL AS administrativeDistrictId, NULL AS administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId\n ) as countryAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countryAreaMap.countryId\n ) AS areaMappedTallySheet\nWHERE\n areaMappedTallySheet.rootElectionId = $rootElectionId\n and areaMappedTallySheet.administrativeDistrictId IN ($administrativeDistrictIds)\n and areaMappedTallySheet.status = 'Verified'\n\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Verified", + "transform": "table", + "type": "table" + }, + { + "columns": [], + "datasource": null, + "fontSize": "100%", + "gridPos": { + "h": 19, + "w": 3, + "x": 12, + "y": 2 + }, + "id": 8, + "pageSize": null, + "showHeader": true, + "sort": { + "col": null, + "desc": false + }, + "styles": [ + { + "alias": "Time", + "align": "left", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "link": false, + "pattern": "Time", + "preserveFormat": true, + "sanitize": true, + "type": "string" + }, + { + "alias": "", + "align": "left", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "preserveFormat": true, + "sanitize": true, + "thresholds": [], + "type": "string", + "unit": "short" + } + ], + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT \n CONCAT(\n '
', tallySheetAreaLabel, '
', templateName, IF(voteType='Postal', ' (PV)', ''), '') \n AS \"\" \nFROM\n (\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countingCentreAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n CONCAT(countingCentreAreaMap.pollingDivisionName, \" / \", countingCentreAreaMap.countingCentreName) as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n areaMap.countingCentreId, areaMap.countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId,\n areaMap.countingCentreId\n ) as countingCentreAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countingCentreAreaMap.countingCentreId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, pollingDivisionAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n pollingDivisionAreaMap.pollingDivisionName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId\n ) as pollingDivisionAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = pollingDivisionAreaMap.pollingDivisionId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, administrativeDistrictAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n administrativeDistrictAreaMap.administrativeDistrictName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId\n ) as administrativeDistrictAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = administrativeDistrictAreaMap.administrativeDistrictId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countryAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n countryAreaMap.countryName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n NULL AS administrativeDistrictId, NULL AS administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId\n ) as countryAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countryAreaMap.countryId\n ) AS areaMappedTallySheet\nWHERE\n areaMappedTallySheet.rootElectionId = $rootElectionId\n and areaMappedTallySheet.administrativeDistrictId IN ($administrativeDistrictIds)\n and areaMappedTallySheet.status = 'Ready to Certify'\n\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Ready to Certify", + "transform": "table", + "type": "table" + }, + { + "columns": [], + "datasource": null, + "fontSize": "100%", + "gridPos": { + "h": 19, + "w": 3, + "x": 15, + "y": 2 + }, + "id": 9, + "pageSize": null, + "showHeader": true, + "sort": { + "col": null, + "desc": false + }, + "styles": [ + { + "alias": "Time", + "align": "left", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "link": false, + "pattern": "Time", + "preserveFormat": true, + "sanitize": true, + "type": "string" + }, + { + "alias": "", + "align": "left", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "preserveFormat": true, + "sanitize": true, + "thresholds": [], + "type": "string", + "unit": "short" + } + ], + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT \n CONCAT(\n '
', tallySheetAreaLabel, '
', templateName, IF(voteType='Postal', ' (PV)', ''), '') \n AS \"\" \nFROM\n (\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countingCentreAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n CONCAT(countingCentreAreaMap.pollingDivisionName, \" / \", countingCentreAreaMap.countingCentreName) as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n areaMap.countingCentreId, areaMap.countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId,\n areaMap.countingCentreId\n ) as countingCentreAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countingCentreAreaMap.countingCentreId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, pollingDivisionAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n pollingDivisionAreaMap.pollingDivisionName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId\n ) as pollingDivisionAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = pollingDivisionAreaMap.pollingDivisionId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, administrativeDistrictAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n administrativeDistrictAreaMap.administrativeDistrictName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId\n ) as administrativeDistrictAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = administrativeDistrictAreaMap.administrativeDistrictId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countryAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n countryAreaMap.countryName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n NULL AS administrativeDistrictId, NULL AS administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId\n ) as countryAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countryAreaMap.countryId\n ) AS areaMappedTallySheet\nWHERE\n areaMappedTallySheet.rootElectionId = $rootElectionId\n and areaMappedTallySheet.administrativeDistrictId IN ($administrativeDistrictIds)\n and areaMappedTallySheet.status = 'Certified'\n\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Certified", + "transform": "table", + "type": "table" + }, + { + "columns": [], + "datasource": null, + "fontSize": "100%", + "gridPos": { + "h": 19, + "w": 3, + "x": 18, + "y": 2 + }, + "id": 10, + "pageSize": null, + "showHeader": true, + "sort": { + "col": null, + "desc": false + }, + "styles": [ + { + "alias": "Time", + "align": "left", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "link": false, + "pattern": "Time", + "preserveFormat": true, + "sanitize": true, + "type": "string" + }, + { + "alias": "", + "align": "left", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "preserveFormat": true, + "sanitize": true, + "thresholds": [], + "type": "string", + "unit": "short" + } + ], + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT \n CONCAT(\n '
', tallySheetAreaLabel, '
', templateName, IF(voteType='Postal', ' (PV)', ''), '') \n AS \"\" \nFROM\n (\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countingCentreAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n CONCAT(countingCentreAreaMap.pollingDivisionName, \" / \", countingCentreAreaMap.countingCentreName) as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n areaMap.countingCentreId, areaMap.countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId,\n areaMap.countingCentreId\n ) as countingCentreAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countingCentreAreaMap.countingCentreId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, pollingDivisionAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n pollingDivisionAreaMap.pollingDivisionName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId\n ) as pollingDivisionAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = pollingDivisionAreaMap.pollingDivisionId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, administrativeDistrictAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n administrativeDistrictAreaMap.administrativeDistrictName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId\n ) as administrativeDistrictAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = administrativeDistrictAreaMap.administrativeDistrictId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countryAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n countryAreaMap.countryName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n NULL AS administrativeDistrictId, NULL AS administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId\n ) as countryAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countryAreaMap.countryId\n ) AS areaMappedTallySheet\nWHERE\n areaMappedTallySheet.rootElectionId = $rootElectionId\n and areaMappedTallySheet.administrativeDistrictId IN ($administrativeDistrictIds)\n and areaMappedTallySheet.status = 'Released'\n\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Released", + "transform": "table", + "type": "table" + }, + { + "cacheTimeout": null, + "datasource": null, + "gridPos": { + "h": 2, + "w": 3, + "x": 0, + "y": 21 + }, + "id": 11, + "links": [], + "options": { + "colorMode": "value", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [ + { + "id": 0, + "op": "=", + "text": "N/A", + "type": 1, + "value": "null" + } + ], + "nullValueMode": "connected", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [], + "values": false + }, + "graphMode": "area", + "justifyMode": "center", + "orientation": "horizontal" + }, + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT \n COUNT(tallySheetId)\nFROM\n (\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countingCentreAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n CONCAT(countingCentreAreaMap.pollingDivisionName, \" / \", countingCentreAreaMap.countingCentreName) as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n areaMap.countingCentreId, areaMap.countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId,\n areaMap.countingCentreId\n ) as countingCentreAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countingCentreAreaMap.countingCentreId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, pollingDivisionAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n pollingDivisionAreaMap.pollingDivisionName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId\n ) as pollingDivisionAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = pollingDivisionAreaMap.pollingDivisionId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, administrativeDistrictAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n administrativeDistrictAreaMap.administrativeDistrictName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId\n ) as administrativeDistrictAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = administrativeDistrictAreaMap.administrativeDistrictId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countryAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n countryAreaMap.countryName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n NULL AS administrativeDistrictId, NULL AS administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId\n ) as countryAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countryAreaMap.countryId\n ) AS areaMappedTallySheet\nWHERE\n areaMappedTallySheet.rootElectionId = $rootElectionId\n and areaMappedTallySheet.administrativeDistrictId IN ($administrativeDistrictIds)\n and areaMappedTallySheet.status = 'Empty'\n\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "stat" + }, + { + "datasource": null, + "gridPos": { + "h": 2, + "w": 3, + "x": 3, + "y": 21 + }, + "id": 12, + "options": { + "colorMode": "value", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [], + "values": false + }, + "graphMode": "area", + "justifyMode": "center", + "orientation": "auto" + }, + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT \n COUNT(tallySheetId)\nFROM\n (\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countingCentreAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n CONCAT(countingCentreAreaMap.pollingDivisionName, \" / \", countingCentreAreaMap.countingCentreName) as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n areaMap.countingCentreId, areaMap.countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId,\n areaMap.countingCentreId\n ) as countingCentreAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countingCentreAreaMap.countingCentreId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, pollingDivisionAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n pollingDivisionAreaMap.pollingDivisionName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId\n ) as pollingDivisionAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = pollingDivisionAreaMap.pollingDivisionId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, administrativeDistrictAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n administrativeDistrictAreaMap.administrativeDistrictName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId\n ) as administrativeDistrictAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = administrativeDistrictAreaMap.administrativeDistrictId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countryAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n countryAreaMap.countryName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n NULL AS administrativeDistrictId, NULL AS administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId\n ) as countryAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countryAreaMap.countryId\n ) AS areaMappedTallySheet\nWHERE\n areaMappedTallySheet.rootElectionId = $rootElectionId\n and areaMappedTallySheet.administrativeDistrictId IN ($administrativeDistrictIds)\n and areaMappedTallySheet.status = 'Saved'\n\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "stat" + }, + { + "datasource": null, + "gridPos": { + "h": 2, + "w": 3, + "x": 6, + "y": 21 + }, + "id": 13, + "options": { + "colorMode": "value", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [], + "values": false + }, + "graphMode": "area", + "justifyMode": "center", + "orientation": "auto" + }, + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT \n COUNT(tallySheetId)\nFROM\n (\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countingCentreAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n CONCAT(countingCentreAreaMap.pollingDivisionName, \" / \", countingCentreAreaMap.countingCentreName) as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n areaMap.countingCentreId, areaMap.countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId,\n areaMap.countingCentreId\n ) as countingCentreAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countingCentreAreaMap.countingCentreId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, pollingDivisionAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n pollingDivisionAreaMap.pollingDivisionName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId\n ) as pollingDivisionAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = pollingDivisionAreaMap.pollingDivisionId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, administrativeDistrictAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n administrativeDistrictAreaMap.administrativeDistrictName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId\n ) as administrativeDistrictAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = administrativeDistrictAreaMap.administrativeDistrictId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countryAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n countryAreaMap.countryName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n NULL AS administrativeDistrictId, NULL AS administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId\n ) as countryAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countryAreaMap.countryId\n ) AS areaMappedTallySheet\nWHERE\n areaMappedTallySheet.rootElectionId = $rootElectionId\n and areaMappedTallySheet.administrativeDistrictId IN ($administrativeDistrictIds)\n and areaMappedTallySheet.status = 'Submitted'\n\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "stat" + }, + { + "datasource": null, + "gridPos": { + "h": 2, + "w": 3, + "x": 9, + "y": 21 + }, + "id": 14, + "options": { + "colorMode": "value", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [], + "values": false + }, + "graphMode": "area", + "justifyMode": "center", + "orientation": "auto" + }, + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT \n COUNT(tallySheetId)\nFROM\n (\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countingCentreAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n CONCAT(countingCentreAreaMap.pollingDivisionName, \" / \", countingCentreAreaMap.countingCentreName) as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n areaMap.countingCentreId, areaMap.countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId,\n areaMap.countingCentreId\n ) as countingCentreAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countingCentreAreaMap.countingCentreId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, pollingDivisionAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n pollingDivisionAreaMap.pollingDivisionName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId\n ) as pollingDivisionAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = pollingDivisionAreaMap.pollingDivisionId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, administrativeDistrictAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n administrativeDistrictAreaMap.administrativeDistrictName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId\n ) as administrativeDistrictAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = administrativeDistrictAreaMap.administrativeDistrictId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countryAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n countryAreaMap.countryName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n NULL AS administrativeDistrictId, NULL AS administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId\n ) as countryAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countryAreaMap.countryId\n ) AS areaMappedTallySheet\nWHERE\n areaMappedTallySheet.rootElectionId = $rootElectionId\n and areaMappedTallySheet.administrativeDistrictId IN ($administrativeDistrictIds)\n and areaMappedTallySheet.status = 'Verified'\n\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "stat" + }, + { + "datasource": null, + "gridPos": { + "h": 2, + "w": 3, + "x": 12, + "y": 21 + }, + "id": 15, + "options": { + "colorMode": "value", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [], + "values": false + }, + "graphMode": "area", + "justifyMode": "center", + "orientation": "auto" + }, + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT \n COUNT(tallySheetId)\nFROM\n (\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countingCentreAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n CONCAT(countingCentreAreaMap.pollingDivisionName, \" / \", countingCentreAreaMap.countingCentreName) as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n areaMap.countingCentreId, areaMap.countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId,\n areaMap.countingCentreId\n ) as countingCentreAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countingCentreAreaMap.countingCentreId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, pollingDivisionAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n pollingDivisionAreaMap.pollingDivisionName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId\n ) as pollingDivisionAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = pollingDivisionAreaMap.pollingDivisionId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, administrativeDistrictAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n administrativeDistrictAreaMap.administrativeDistrictName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId\n ) as administrativeDistrictAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = administrativeDistrictAreaMap.administrativeDistrictId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countryAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n countryAreaMap.countryName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n NULL AS administrativeDistrictId, NULL AS administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId\n ) as countryAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countryAreaMap.countryId\n ) AS areaMappedTallySheet\nWHERE\n areaMappedTallySheet.rootElectionId = $rootElectionId\n and areaMappedTallySheet.administrativeDistrictId IN ($administrativeDistrictIds)\n and areaMappedTallySheet.status = 'Ready to Certify'\n\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "stat" + }, + { + "datasource": null, + "gridPos": { + "h": 2, + "w": 3, + "x": 15, + "y": 21 + }, + "id": 16, + "options": { + "colorMode": "value", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [], + "values": false + }, + "graphMode": "area", + "justifyMode": "center", + "orientation": "auto" + }, + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT \n COUNT(tallySheetId)\nFROM\n (\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countingCentreAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n CONCAT(countingCentreAreaMap.pollingDivisionName, \" / \", countingCentreAreaMap.countingCentreName) as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n areaMap.countingCentreId, areaMap.countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId,\n areaMap.countingCentreId\n ) as countingCentreAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countingCentreAreaMap.countingCentreId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, pollingDivisionAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n pollingDivisionAreaMap.pollingDivisionName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId\n ) as pollingDivisionAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = pollingDivisionAreaMap.pollingDivisionId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, administrativeDistrictAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n administrativeDistrictAreaMap.administrativeDistrictName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId\n ) as administrativeDistrictAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = administrativeDistrictAreaMap.administrativeDistrictId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countryAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n countryAreaMap.countryName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n NULL AS administrativeDistrictId, NULL AS administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId\n ) as countryAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countryAreaMap.countryId\n ) AS areaMappedTallySheet\nWHERE\n areaMappedTallySheet.rootElectionId = $rootElectionId\n and areaMappedTallySheet.administrativeDistrictId IN ($administrativeDistrictIds)\n and areaMappedTallySheet.status = 'Certified'\n\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "stat" + }, + { + "datasource": null, + "gridPos": { + "h": 2, + "w": 3, + "x": 18, + "y": 21 + }, + "id": 17, + "options": { + "colorMode": "value", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [], + "values": false + }, + "graphMode": "area", + "justifyMode": "center", + "orientation": "auto" + }, + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "SELECT \n COUNT(tallySheetId)\nFROM\n (\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countingCentreAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n CONCAT(countingCentreAreaMap.pollingDivisionName, \" / \", countingCentreAreaMap.countingCentreName) as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n areaMap.countingCentreId, areaMap.countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId,\n areaMap.countingCentreId\n ) as countingCentreAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countingCentreAreaMap.countingCentreId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, pollingDivisionAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n pollingDivisionAreaMap.pollingDivisionName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n areaMap.pollingDivisionId, areaMap.pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId,\n areaMap.pollingDivisionId\n ) as pollingDivisionAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = pollingDivisionAreaMap.pollingDivisionId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, administrativeDistrictAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n administrativeDistrictAreaMap.administrativeDistrictName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n areaMap.administrativeDistrictId, areaMap.administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId,\n areaMap.administrativeDistrictId\n ) as administrativeDistrictAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = administrativeDistrictAreaMap.administrativeDistrictId\n\n UNION ALL\n\n SELECT\n tallySheet.tallySheetId, workflowInstance.status, template.templateName, countryAreaMap.*,\n election.electionId, election.voteType, election.rootElectionId,\n countryAreaMap.countryName as tallySheetAreaLabel\n FROM\n submission, tallySheet, template, workflowInstance, election,\n (\n SELECT\n areaMap.countryId, areaMap.countryName,\n NULL AS administrativeDistrictId, NULL AS administrativeDistrictName,\n NULL AS pollingDivisionId, NULL AS pollingDivisionName,\n NULL AS countingCentreId, NULL AS countingCentreName\n FROM\n (SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n pollingDivision.areaId as pollingDivisionId, pollingDivision.areaName as pollingDivisionName,\n pollingDistrict.areaId as pollingDistrictId, pollingDistrict.areaName as pollingDistrictName,\n pollingStation.areaId as pollingStationId, pollingStation.areaName as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"NonPostal\" as voteType\n FROM\n area country, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_pollingDivision,\n area_area pollingDivision_pollingDistrict,\n area_area pollingDistrict_pollingStation,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre,\n area_area countingCentre_pollingStation\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId\n \n and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId\n and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId\n \n and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId\n and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and countingCentre_pollingStation.parentAreaId = countingCentre.areaId\n and countingCentre_pollingStation.childAreaId = pollingStation.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and pollingDivision.areaType = \"PollingDivision\" and pollingDistrict.areaType = \"PollingDistrict\"\n and pollingStation.areaType = \"PollingStation\" and countingCentre.areaType = \"CountingCentre\"\n and districtCentre.areaType = \"DistrictCentre\" and electionCommission.areaType = \"ElectionCommission\"\n UNION SELECT\n country.areaId as countryId, country.areaName as countryName,\n administrativeDistrict.areaId as administrativeDistrictId, administrativeDistrict.areaName as administrativeDistrictName,\n NULL as pollingDivisionId, \"Postal\" as pollingDivisionName,\n NULL as pollingDistrictId, NULL as pollingDistrictName,\n NULL as pollingStationId, NULL as pollingStationName,\n electionCommission.areaId as electionCommissionId, electionCommission.areaName as electionCommissionName,\n districtCentre.areaId as districtCentreId, districtCentre.areaName as districtCentreName,\n countingCentre.areaId as countingCentreId, countingCentre.areaName as countingCentreName,\n \"Postal\" AS voteType\n FROM\n area country, area administrativeDistrict,\n area electionCommission, area districtCentre, area countingCentre,\n \n area_area country_administrativeDistrict,\n area_area administrativeDistrict_countingCentre,\n \n area_area electionCommission_districtCentre,\n area_area districtCentre_countingCentre\n WHERE\n country_administrativeDistrict.parentAreaId = country.areaId\n and country_administrativeDistrict.childAreaId = administrativeDistrict.areaId\n \n and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId\n and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId\n \n and electionCommission_districtCentre.parentAreaId = electionCommission.areaId\n and electionCommission_districtCentre.childAreaId = districtCentre.areaId\n \n and districtCentre_countingCentre.parentAreaId = districtCentre.areaId\n and districtCentre_countingCentre.childAreaId = countingCentre.areaId\n \n and country.areaType = \"Country\" and administrativeDistrict.areaType = \"AdministrativeDistrict\"\n and countingCentre.areaType = \"CountingCentre\" and districtCentre.areaType = \"DistrictCentre\"\n and electionCommission.areaType = \"ElectionCommission\"\n ) AS areaMap\n GROUP BY\n areaMap.countryId\n ) as countryAreaMap\n WHERE\n tallySheet.tallySheetId = submission.submissionId\n and election.electionId = submission.electionId\n and template.templateId = tallySheet.templateId\n and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId\n and submission.areaId = countryAreaMap.countryId\n ) AS areaMappedTallySheet\nWHERE\n areaMappedTallySheet.rootElectionId = $rootElectionId\n and areaMappedTallySheet.administrativeDistrictId IN ($administrativeDistrictIds)\n and areaMappedTallySheet.status = 'Released'\n\n", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "stat" + } + ], + "refresh": "5m", + "schemaVersion": 22, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "text": "314 - Parliament Election 2020", + "value": "314" + }, + "datasource": "MySQL", + "definition": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PARLIAMENT_ELECTION_2020' and parentElectionId IS NULL;", + "hide": 0, + "includeAll": false, + "index": -1, + "label": "Election", + "multi": false, + "name": "rootElectionId", + "options": [], + "query": "SELECT CONCAT(electionId, ' - ', electionName) as __text, electionId as __value from election WHERE electionTemplateName = 'PARLIAMENT_ELECTION_2020' and parentElectionId IS NULL;", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": { + "text": "01-Colombo", + "value": "36926" + }, + "datasource": "MySQL", + "definition": "SELECT \n areaName AS __text, areaId AS __value \nFROM area, election \nWHERE \n election.electionId = area.electionId and election.rootElectionId = $rootElectionId and areaType = 'AdministrativeDistrict';", + "hide": 0, + "includeAll": false, + "index": -1, + "label": "Administrative District", + "multi": false, + "name": "administrativeDistrictIds", + "options": [], + "query": "SELECT \n areaName AS __text, areaId AS __value \nFROM area, election \nWHERE \n election.electionId = area.electionId and election.rootElectionId = $rootElectionId and areaType = 'AdministrativeDistrict';", + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "Provincial Council Election 2021 - Tally Sheet Status", + "uid": "JB6-W36Zaz", + "variables": { + "list": [] + }, + "version": 1 +} \ No newline at end of file