diff --git a/.github/workflows/platformer-b543d3c0-2b9f-4b3a-b87b-6d3bb0c64537.yml b/.github/workflows/platformer-b543d3c0-2b9f-4b3a-b87b-6d3bb0c64537.yml new file mode 100644 index 00000000..857c6324 --- /dev/null +++ b/.github/workflows/platformer-b543d3c0-2b9f-4b3a-b87b-6d3bb0c64537.yml @@ -0,0 +1,40 @@ +name: Platformer Generated dbu-dev-master-push Build +on: + push: + branches: + - master +jobs: + build: + runs-on: + - ubuntu-latest + env: + SERVICE_NAME: ghcr.io/eclk/results-tabulation + CONTAINER_REGISTRY: ghcr.io + steps: + - uses: actions/checkout@v2 + - name: Set Version + id: event-version + run: echo ::set-output + name=SOURCE_TAG::${GITHUB_REF#refs/heads/}-${{github.sha}} + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ${{ env.CONTAINER_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build the Docker image + run: docker build --tag + ${SERVICE_NAME}:update-${{steps.event-version.outputs.SOURCE_TAG }} --file + ./results-tabulation-dashboard/Dockerfile + ./results-tabulation-dashboard/ + - name: GitHub Image Push + run: docker push $SERVICE_NAME:update-${{steps.event-version.outputs.SOURCE_TAG }} + - name: Platformer Deploy + uses: platformer-com/build-deploy-action@v1 + with: + org-id: ${{secrets.ORG_ID_9CBA253F_B6ED_4CD0_B890_70A3810F0633}} + project-id: ${{secrets.PROJECT_ID_9CBA253F_B6ED_4CD0_B890_70A3810F0633}} + token: ${{secrets.AUTOGENERATED_CICD_9CBA253F_B6ED_4CD0_B890_70A3810F0633}} + image-name: ${{env.SERVICE_NAME}} + tag: update-${{steps.event-version.outputs.SOURCE_TAG }} + container-id: b852a116-f1eb-4800-80fb-47ba926442eb 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-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/ExtendedTallySheet/ExtendedTallySheet_PCE_R2.py b/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/ExtendedTallySheet/ExtendedTallySheet_PCE_R2.py index 9da0275b..90128294 100644 --- a/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/ExtendedTallySheet/ExtendedTallySheet_PCE_R2.py +++ b/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/ExtendedTallySheet/ExtendedTallySheet_PCE_R2.py @@ -81,10 +81,9 @@ def get_post_save_request_content(self): election = self.tallySheetVersion.tallySheet.election tally_sheet_id = self.tallySheetVersion.tallySheetId - minimum_vote_count_percentage_required = election.meta.get_meta_data( - metaDataKey=META_DATA_KEY_ELECTION_NUMBER_OF_VALID_VOTE_PERCENTAGE_REQUIRED_FOR_SEAT_ALLOCATION) + minimum_vote_count_percentage_required = 0.00 if minimum_vote_count_percentage_required is not None: - minimum_vote_count_percentage_required = float(minimum_vote_count_percentage_required) + minimum_vote_count_percentage_required = float(0.00) number_of_members_to_be_elected = election.meta.get_meta_data( metaDataKey=META_DATA_KEY_ELECTION_NUMBER_OF_SEATS_ALLOCATED) @@ -166,15 +165,15 @@ def populate_seats_per_party(self, minimum_vote_count_percentage_required, numbe # df.at[index, 'bonusSeatsAllocated'] = 0 valid_vote_count_required_per_seat = total_valid_vote_count_of_qualified_parties / number_of_members_to_be_elected - valid_vote_count_required_per_seat_ceil = math.ceil(valid_vote_count_required_per_seat) + valid_vote_count_required_per_seat_floor = math.floor(valid_vote_count_required_per_seat) for index in df.index: num_value = df.at[index, 'numValue'] if df.at[index, 'qualifiedForSeatsAllocation']: - number_of_seats_qualified = math.floor(num_value / valid_vote_count_required_per_seat_ceil) + number_of_seats_qualified = math.floor(num_value / valid_vote_count_required_per_seat_floor) df.at[index, 'seatsAllocatedFromRound1'] = number_of_seats_qualified number_of_members_to_be_elected -= number_of_seats_qualified - df.at[index, 'validVotesRemainFromRound1'] = num_value % valid_vote_count_required_per_seat_ceil + df.at[index, 'validVotesRemainFromRound1'] = num_value % valid_vote_count_required_per_seat_floor else: df.at[index, 'seatsAllocatedFromRound1'] = 0 df.at[index, 'validVotesRemainFromRound1'] = 0 @@ -197,7 +196,7 @@ def populate_seats_per_party(self, minimum_vote_count_percentage_required, numbe df = df.sort_values(by=['numValue'], ascending=False) df["voteCountCeilPerSeat"] = pd.Series( - np.full(len(df.index), valid_vote_count_required_per_seat_ceil), + np.full(len(df.index), valid_vote_count_required_per_seat_floor), index=df.index) df["minimumVoteCountRequiredForSeatAllocation"] = pd.Series( np.full(len(df.index), _minimum_valid_vote_count_required_per_party_to_be_qualified), @@ -246,8 +245,7 @@ def html(self, title="", total_registered_voters=None): election = self.tallySheetVersion.tallySheet.election tally_sheet_id = self.tallySheetVersion.tallySheetId - minimum_vote_count_percentage_required = float(election.meta.get_meta_data( - metaDataKey=META_DATA_KEY_ELECTION_NUMBER_OF_VALID_VOTE_PERCENTAGE_REQUIRED_FOR_SEAT_ALLOCATION)) + minimum_vote_count_percentage_required = float(0.00) minimum_valid_vote_count_required_per_party_to_be_qualified = total_valid_vote_count * minimum_vote_count_percentage_required diff --git a/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/__init__.py b/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/__init__.py index da6d8609..e55f23ea 100644 --- a/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/__init__.py +++ b/results-tabulation-api/ext/ExtendedElection/ExtendedElectionProvincialCouncilElection2021/__init__.py @@ -985,7 +985,7 @@ def _get_district_centre_entry(row): ) administrative_district_election.meta.add_meta_data( metaDataKey=META_DATA_KEY_ELECTION_NUMBER_OF_VALID_VOTE_PERCENTAGE_REQUIRED_FOR_SEAT_ALLOCATION, - metaDataValue=0.05 + metaDataValue=0.00 ) # extract_csv_files() diff --git a/results-tabulation-api/requirements.txt b/results-tabulation-api/requirements.txt index 363b72fd..68bfcc02 100644 --- a/results-tabulation-api/requirements.txt +++ b/results-tabulation-api/requirements.txt @@ -7,7 +7,7 @@ chardet==3.0.4 Click==7.0 clickclick==1.2.2 connexion==2.2.0 -cryptography==3.2 +cryptography==3.3.2 decorator==4.4.0 docopt==0.6.2 ecdsa==0.15 diff --git a/results-tabulation-api/templates/ProvincialCouncilElection2021/PCE-R2.html b/results-tabulation-api/templates/ProvincialCouncilElection2021/PCE-R2.html index df05c05b..76c3cf7f 100644 --- a/results-tabulation-api/templates/ProvincialCouncilElection2021/PCE-R2.html +++ b/results-tabulation-api/templates/ProvincialCouncilElection2021/PCE-R2.html @@ -30,238 +30,238 @@

PCE/R2

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Calculating the number of MPs elected
- 1. Total number of valid votes counted - :- -
{{content.totalVoteCounts}}
-
- 2. 1/20th portion of the total valid votes - :- -
{{content.twentiethOfTotalVoteCounts}}
-
- 3. Total number of votes polled by all parties and independent groups - with less than 1/20 of the total valid votes - :- -
{{content.total_less_than_twentiethOfTotalVoteCounts}}
-
- 4. Calculating the relevant number of votes -
- To calculate the relevant number of votes, the total number of - votes obtained by all parties and independent groups with less - than 1/20 of the total valid votes (sum referred to in 3 above) - should be deducted from the total number of valid votes (sum referred - to in 1 above). -
- The deduction is indicated below. -
-
-
(I)
-
 
-
Total number of valid votes
-
-
= -
{{content.totalVoteCounts}}
-
-
-
(II)
-
 
-
Total number of votes polled by all parties and groups with - less than 1/20 of the total valid votes
-
-
= -
{{content.total_less_than_twentiethOfTotalVoteCounts}}
-
-
-
(III)
-
 
-
The number of votes resulting from such deduction (relevant - number of votes)
-
-
= -
{{content.total_votes_after_deduction}}
-
- 5. Calculating the resulting number -
-
-
I.
-
 
-
To get the answer, the relevant number of votes (sum referred to - in 4 (III) above) should be divided by the number of members to - be elected for the relevant administrative district reduced by one.
-
-
-
-
II.
-
 
-
The number of members to be elected for the administrative - district deducted by one
-
-
:- -
{{content.number_of_members_to_be_elected_minus_1}}
-
-
-
III.
-
 
-
The relevant number of votes (number refered to in 4(III) - above) shall be divided by the number of members to be elected - for that administrative district reduced by one (number referred to in - 5(II) above) (indicate in interger and fractions)
-
-
:- -
{{content.relevant_no_of_votes_div_by_no_of_members}}
-
- (If the number resulting from such division is an integer, that - integer, or if that number is an integer and fraction, the integer - immediately higher to that integer and fraction is deemed as the - “resulting number.”) -
- 6. Accordingly, the resulting number is - :- -
{{content.rounded_relevant_no_of_votes_div_by_no_of_members}}
-
-
-
7.
-
 
-
Details of the parties and independent groups entitled for the - number of {{content.number_of_members_to_be_elected_minus_1}} members - to be elected for the relevant administrative district - reduced by one (enter only the details of parties and groups entitled - for members to be retuned)
-
-
-
-
 
-
(N.B. :- The number of votes polled by each party / independent - group beginning with the party or group which polled the highest - number of votes (descending order) shall be indicated in the second - column against their names to be mentioned in the first column.)
-
-
+{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{##} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{##} +{# #} +{# #} +{# #} +{##} +{# #} +{# #} +{# #} +{# #} +{##} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{##} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{##} +{##} +{##} +{# #} +{# #} +{# #} +{##} +{# #} +{# #} +{# #} +{# #} +{##} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{##} +{##} +{##} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{##} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{#
Calculating the number of MPs elected
#} +{# 1. Total number of valid votes counted#} +{# :-#} +{#
{{content.totalVoteCounts}}
#} +{#
#} +{# 2. 1/20th portion of the total valid votes#} +{# :-#} +{#
{{content.twentiethOfTotalVoteCounts}}
#} +{#
#} +{# 3. Total number of votes polled by all parties and independent groups#} +{# with less than 1/20 of the total valid votes#} +{# :-#} +{#
{{content.total_less_than_twentiethOfTotalVoteCounts}}
#} +{#
#} +{# 4. Calculating the relevant number of votes#} +{#
#} +{# To calculate the relevant number of votes, the total number of#} +{# votes obtained by all parties and independent groups with less#} +{# than 1/20 of the total valid votes (sum referred to in 3 above)#} +{# should be deducted from the total number of valid votes (sum referred#} +{# to in 1 above).#} +{#
#} +{# The deduction is indicated below.#} +{#
#} +{#
#} +{#
(I)
#} +{#
 
#} +{#
Total number of valid votes
#} +{#
#} +{#
=#} +{#
{{content.totalVoteCounts}}
#} +{#
#} +{#
#} +{#
(II)
#} +{#
 
#} +{#
Total number of votes polled by all parties and groups with#} +{# less than 1/20 of the total valid votes
#} +{#
#} +{#
=#} +{#
{{content.total_less_than_twentiethOfTotalVoteCounts}}
#} +{#
#} +{#
#} +{#
(III)
#} +{#
 
#} +{#
The number of votes resulting from such deduction (relevant#} +{# number of votes)
#} +{#
#} +{#
=#} +{#
{{content.total_votes_after_deduction}}
#} +{#
#} +{# 5. Calculating the resulting number#} +{#
#} +{#
#} +{#
I.
#} +{#
 
#} +{#
To get the answer, the relevant number of votes (sum referred to#} +{# in 4 (III) above) should be divided by the number of members to#} +{# be elected for the relevant administrative district reduced by one.
#} +{#
#} +{#
#} +{#
#} +{#
II.
#} +{#
 
#} +{#
The number of members to be elected for the administrative#} +{# district deducted by one
#} +{#
#} +{#
:-#} +{#
{{content.number_of_members_to_be_elected_minus_1}}
#} +{#
#} +{#
#} +{#
III.
#} +{#
 
#} +{#
The relevant number of votes (number refered to in 4(III)#} +{# above) shall be divided by the number of members to be elected#} +{# for that administrative district reduced by one (number referred to in#} +{# 5(II) above) (indicate in interger and fractions)
#} +{#
#} +{#
:-#} +{#
{{content.relevant_no_of_votes_div_by_no_of_members}}
#} +{#
#} +{# (If the number resulting from such division is an integer, that#} +{# integer, or if that number is an integer and fraction, the integer#} +{# immediately higher to that integer and fraction is deemed as the#} +{# “resulting number.”)#} +{#
#} +{# 6. Accordingly, the resulting number is#} +{# :-#} +{#
{{content.rounded_relevant_no_of_votes_div_by_no_of_members}}
#} +{#
#} +{#
#} +{#
7.
#} +{#
 
#} +{#
Details of the parties and independent groups entitled for the#} +{# number of {{content.number_of_members_to_be_elected_minus_1}} members#} +{# to be elected for the relevant administrative district#} +{# reduced by one (enter only the details of parties and groups entitled#} +{# for members to be retuned)
#} +{#
#} +{#
#} +{#
#} +{#
 
#} +{#
(N.B. :- The number of votes polled by each party / independent#} +{# group beginning with the party or group which polled the highest#} +{# number of votes (descending order) shall be indicated in the second#} +{# column against their names to be mentioned in the first column.)
#} +{#
#} +{#
#} @@ -305,25 +305,25 @@

PCE/R2

- - - - - - - -
-
-
8.
-
 
-
The number of members equal to the whole number resulting from - the division by the resulting number of the votes polled by each - party/group should be indicated in the 3rd column, the number of - members elected on the basis of the highest of the remainder in the votes - if any, in the 5th column, and the total number - of members allotted to each party/group should be indicated in the 7th column.
-
-
+{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{# #} +{#
#} +{#
#} +{#
8.
#} +{#
 
#} +{#
The number of members equal to the whole number resulting from#} +{# the division by the resulting number of the votes polled by each#} +{# party/group should be indicated in the 3rd column, the number of#} +{# members elected on the basis of the highest of the remainder in the votes#} +{# if any, in the 5th column, and the total number#} +{# of members allotted to each party/group should be indicated in the 7th column.
#} +{#
#} +{#
#} diff --git a/results-tabulation-dashboard/provincial-council-election-2021/create-dashboard-tables-and-views.sql b/results-tabulation-dashboard/provincial-council-election-2021/create-dashboard-tables-and-views.sql new file mode 100644 index 00000000..520d9398 --- /dev/null +++ b/results-tabulation-dashboard/provincial-council-election-2021/create-dashboard-tables-and-views.sql @@ -0,0 +1,188 @@ +CREATE TABLE IF NOT EXISTS ext_pce2021_dashboard_increment ( + id INT AUTO_INCREMENT NOT NULL, + active INT, + PRIMARY KEY(id) +) ENGINE=INNODB; + +CREATE TABLE IF NOT EXISTS ext_pce2021_dashboard_tally_sheet_status ( + id INT AUTO_INCREMENT, + incrementId INT NOT NULL, + electionId INT NOT NULL, + provinceId INT, + administrativeDistrictId INT, + pollingDivisionId INT, + countingCentreId INT, + templateName VARCHAR(50) NOT NULL, + voteType VARCHAR(50) NOT NULL, + partyId INT, + verifiedTallySheetCount INT NOT NULL, + releasedTallySheetCount INT NOT NULL, + emptyTallySheetCount INT NOT NULL, + savedTallySheetCount INT NOT NULL, + totalTallySheetCount INT NOT NULL, + PRIMARY KEY(id) +) ENGINE=INNODB; + +CREATE TABLE IF NOT EXISTS ext_pce2021_dashboard_party_wise_vote_results ( + id INT AUTO_INCREMENT, + incrementId INT NOT NULL, + electionId INT NOT NULL, + provinceId INT, + administrativeDistrictId INT, + pollingDivisionId INT, + countingCentreId INT, + voteType VARCHAR(50) NOT NULL, + partyId INT, + voteCount INT, + PRIMARY KEY(id) +) ENGINE=INNODB; + +CREATE TABLE IF NOT EXISTS ext_pce2021_dashboard_vote_results ( + id INT AUTO_INCREMENT, + incrementId INT NOT NULL, + electionId INT NOT NULL, + provinceId INT, + administrativeDistrictId INT, + pollingDivisionId INT, + countingCentreId INT, + voteType VARCHAR(50) NOT NULL, + validVoteCount INT, + rejectedVoteCount INT, + voteCount INT, + PRIMARY KEY(id) +) ENGINE=INNODB; + +CREATE TABLE IF NOT EXISTS ext_pce2021_dashboard_party_wise_seat_allocation ( + id INT AUTO_INCREMENT, + incrementId INT NOT NULL, + electionId INT NOT NULL, + administrativeDistrictId INT, + provinceId INT, + partyId INT, + seatCount INT, + PRIMARY KEY(id) +) ENGINE=INNODB; + +CREATE TABLE IF NOT EXISTS ext_pce2021_dashboard_area_map ( + id INT AUTO_INCREMENT, + electionId INT, + countryId INT, + provinceId INT, + administrativeDistrictId INT, + pollingDivisionId INT, + countingCentreId INT, + registeredVotersCount INT, + registeredPostalVotersCount INT, + registeredDisplacedVotersCount INT, + voteType VARCHAR(50) NOT NULL, + PRIMARY KEY(id) +) ENGINE=INNODB; + +DELETE FROM ext_pce2021_dashboard_area_map; + +INSERT INTO ext_pce2021_dashboard_area_map (electionId, countryId, provinceId, administrativeDistrictId, pollingDivisionId, + countingCentreId, voteType, registeredVotersCount, registeredPostalVotersCount, registeredDisplacedVotersCount) + SELECT + country.electionId, + country.areaId as countryId, + province.areaId as provinceId, + administrativeDistrict.areaId as administrativeDistrictId, + pollingDivision.areaId as pollingDivisionId, + countingCentre.areaId as countingCentreId, + "NonPostal" as voteType, + COALESCE(SUM(pollingStation._registeredVotersCount)) AS registeredVotersCount, + COALESCE(SUM(pollingStation._registeredPostalVotersCount)) AS registeredPostalVotersCount, + COALESCE(SUM(pollingStation._registeredDisplacedVotersCount)) AS registeredDisplacedVotersCount + FROM + area country, area province, area administrativeDistrict, area pollingDivision, area pollingDistrict, area pollingStation, + area electionCommission, area districtCentre, area countingCentre, + + area_area country_province, + area_area province_administrativeDistrict, + area_area administrativeDistrict_pollingDivision, + area_area pollingDivision_pollingDistrict, + area_area pollingDistrict_pollingStation, + + area_area electionCommission_districtCentre, + area_area districtCentre_countingCentre, + area_area countingCentre_pollingStation + WHERE + country_province.parentAreaId = country.areaId + and country_province.childAreaId = province.areaId + + and province_administrativeDistrict.parentAreaId = province.areaId + and province_administrativeDistrict.childAreaId = administrativeDistrict.areaId + + and administrativeDistrict_pollingDivision.parentAreaId = administrativeDistrict.areaId + and administrativeDistrict_pollingDivision.childAreaId = pollingDivision.areaId + + and pollingDivision_pollingDistrict.parentAreaId = pollingDivision.areaId + and pollingDivision_pollingDistrict.childAreaId = pollingDistrict.areaId + + and pollingDistrict_pollingStation.parentAreaId = pollingDistrict.areaId + and pollingDistrict_pollingStation.childAreaId = pollingStation.areaId + + and electionCommission_districtCentre.parentAreaId = electionCommission.areaId + and electionCommission_districtCentre.childAreaId = districtCentre.areaId + + and districtCentre_countingCentre.parentAreaId = districtCentre.areaId + and districtCentre_countingCentre.childAreaId = countingCentre.areaId + + and countingCentre_pollingStation.parentAreaId = countingCentre.areaId + and countingCentre_pollingStation.childAreaId = pollingStation.areaId + + and country.areaType = "Country" and administrativeDistrict.areaType = "administrativeDistrict" + and pollingDivision.areaType = "PollingDivision" and pollingDistrict.areaType = "PollingDistrict" + and pollingStation.areaType = "PollingStation" and countingCentre.areaType = "CountingCentre" + and districtCentre.areaType = "DistrictCentre" and electionCommission.areaType = "ElectionCommission" + GROUP BY + country.areaId, + province.areaId, + administrativeDistrict.areaId, + pollingDivision.areaId, + countingCentre.areaId; + +INSERT INTO ext_pce2021_dashboard_area_map (electionId, countryId, provinceId, administrativeDistrictId, pollingDivisionId, + countingCentreId, voteType) + SELECT + country.electionId, + country.areaId as countryId, + province.areaId as provinceId, + administrativeDistrict.areaId as administrativeDistrictId, + administrativeDistrict.areaId as pollingDivisionId, + countingCentre.areaId as countingCentreId, + "Postal" AS voteType + FROM + area country, area province, area administrativeDistrict, + area electionCommission, area districtCentre, area countingCentre, + + area_area country_province, + area_area province_administrativeDistrict, + area_area administrativeDistrict_countingCentre, + + area_area electionCommission_districtCentre, + area_area districtCentre_countingCentre + WHERE + country_province.parentAreaId = country.areaId + and country_province.childAreaId = province.areaId + + and province_administrativeDistrict.parentAreaId = province.areaId + and province_administrativeDistrict.childAreaId = administrativeDistrict.areaId + + and administrativeDistrict_countingCentre.parentAreaId = administrativeDistrict.areaId + and administrativeDistrict_countingCentre.childAreaId = countingCentre.areaId + + and electionCommission_districtCentre.parentAreaId = electionCommission.areaId + and electionCommission_districtCentre.childAreaId = districtCentre.areaId + + and districtCentre_countingCentre.parentAreaId = districtCentre.areaId + and districtCentre_countingCentre.childAreaId = countingCentre.areaId + + and country.areaType = "Country" and province.areaType = "Province" and administrativeDistrict.areaType = "administrativeDistrict" + and countingCentre.areaType = "CountingCentre" and districtCentre.areaType = "DistrictCentre" + and electionCommission.areaType = "ElectionCommission" + GROUP BY + country.areaId, + province.areaId, + administrativeDistrict.areaId, + countingCentre.areaId; diff --git a/results-tabulation-dashboard/provincial-council-election-2021/drop-dashboard-tables-and-views.sql b/results-tabulation-dashboard/provincial-council-election-2021/drop-dashboard-tables-and-views.sql new file mode 100644 index 00000000..9e2eacaa --- /dev/null +++ b/results-tabulation-dashboard/provincial-council-election-2021/drop-dashboard-tables-and-views.sql @@ -0,0 +1,6 @@ +DROP table ext_pce2021_dashboard_increment; +DROP table ext_pce2021_dashboard_tally_sheet_status; +DROP table ext_pce2021_dashboard_area_map; +DROP table ext_pce2021_dashboard_party_wise_vote_results; +DROP table ext_pce2021_dashboard_vote_results; +DROP table ext_pce2021_dashboard_party_wise_seat_allocation; \ No newline at end of file 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 new file mode 100644 index 00000000..0993d85c --- /dev/null +++ b/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-administrative-district-counting.json @@ -0,0 +1,4532 @@ +{ + "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": 55, + "iteration": 1615984216492, + "links": [], + "panels": [ + { + "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": 3, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 27, + "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": "PROVINCIAL COUNTING DASHBOARD - ", + "prefixFontSize": "100%", + "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 ($provinceIds)", + "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": "170%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "first" + }, + { + "content": "", + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 3 + }, + "id": 46, + "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": 4 + }, + "id": 79, + "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-35", + "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": 4 + }, + "id": 38, + "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": "AD", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "#FADE2A", + "full": true, + "lineColor": "rgb(31, 120, 193)", + "show": true, + "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.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": [ + [ + { + "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": 9, + "y": 4 + }, + "id": 18, + "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": "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 + }, + "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.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": [ + [ + { + "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": 14, + "y": 4 + }, + "id": 8, + "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": "PV 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 + }, + "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-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": [ + [ + { + "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": 4 + }, + "id": 107, + "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": "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 + }, + "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-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": [ + [ + { + "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": 9, + "y": 5 + }, + "id": 109, + "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": "CC", + "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.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": [ + [ + { + "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": 14, + "y": 5 + }, + "id": 110, + "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": "PV CC", + "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-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": [ + [ + { + "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": 5 + }, + "id": 111, + "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": "DV CC", + "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-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": [ + [ + { + "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": 24, + "x": 0, + "y": 6 + }, + "id": 45, + "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": 7 + }, + "id": 80, + "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": "CE-201", + "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": 7 + }, + "id": 39, + "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 = \"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": [ + [ + { + "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": 9, + "y": 7 + }, + "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": "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 + }, + "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 = \"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": [ + [ + { + "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": 14, + "y": 7 + }, + "id": 9, + "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": "PV 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 + }, + "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 = \"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": [ + [ + { + "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": 7 + }, + "id": 108, + "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": "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 + }, + "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 = \"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": [ + [ + { + "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": 9, + "y": 8 + }, + "id": 112, + "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": "CC", + "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 = \"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": [ + [ + { + "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": 14, + "y": 8 + }, + "id": 113, + "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": "PV CC", + "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 = \"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": [ + [ + { + "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": 8 + }, + "id": 114, + "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": "DV CC", + "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 = \"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": [ + [ + { + "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": 24, + "x": 0, + "y": 9 + }, + "id": 47, + "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": 10 + }, + "id": 81, + "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-V1", + "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": 10 + }, + "id": 85, + "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-V1\"\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": 9, + "y": 10 + }, + "id": 84, + "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": "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 + }, + "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-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": [ + [ + { + "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": 14, + "y": 10 + }, + "id": 86, + "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": "PV 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 + }, + "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-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": [ + [ + { + "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": 10 + }, + "id": 115, + "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": "PV 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 + }, + "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-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": [ + [ + { + "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": 9, + "y": 11 + }, + "id": 93, + "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-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": [ + [ + { + "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": 14, + "y": 11 + }, + "id": 116, + "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-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": [ + [ + { + "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": 11 + }, + "id": 117, + "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-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": [ + [ + { + "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": 24, + "x": 0, + "y": 12 + }, + "id": 75, + "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": 13 + }, + "id": 15, + "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-4", + "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": 13 + }, + "id": 66, + "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-4\"\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" + }, + { + "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, + "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": 15 + }, + "id": 97, + "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-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", + "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": 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, + "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": 17 + }, + "id": 92, + "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-R2\"\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": 17 + }, + "id": 96, + "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-R2\"\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": 18 + }, + "id": 90, + "mode": "markdown", + "timeFrom": null, + "timeShift": null, + "title": "", + "type": "text" + }, + { + "content": "", + "datasource": null, + "gridPos": { + "h": 1, + "w": 14, + "x": 10, + "y": 18 + }, + "id": 104, + "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": 19 + }, + "id": 100, + "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-3", + "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": 19 + }, + "id": 102, + "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-3\"\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": 19 + }, + "id": 87, + "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-21", + "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": 19 + }, + "id": 91, + "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-21\"\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": 19 + }, + "id": 94, + "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-21\"\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": 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", + "schemaVersion": 22, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "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 = 'PROVINCIAL_COUNCIL_ELECTION_2021' 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 = 'PROVINCIAL_COUNCIL_ELECTION_2021' and parentElectionId IS NULL;", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": { + "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 = 'Province';", + "hide": 0, + "includeAll": false, + "index": -1, + "label": "Province", + "multi": false, + "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, + "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 - Counting - Provincial", + "uid": "GXrbHAVMkz", + "variables": { + "list": [] + }, + "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 new file mode 100644 index 00000000..e35da671 --- /dev/null +++ b/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-administrative-district-results.json @@ -0,0 +1,1619 @@ +{ + "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": 54, + "iteration": 1615981784521, + "links": [], + "panels": [ + { + "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": 3, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 27, + "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 RESULTS DASHBOARD", + "prefixFontSize": "70%", + "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(area.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": "150%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "first" + }, + { + "cacheTimeout": null, + "datasource": null, + "gridPos": { + "h": 7, + "w": 18, + "x": 0, + "y": 3 + }, + "id": 37, + "links": [], + "options": { + "displayMode": "gradient", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "yellow", + "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\", 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": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Top 10 parties", + "transparent": true, + "type": "bargauge" + }, + { + "cacheTimeout": null, + "datasource": null, + "gridPos": { + "h": 17, + "w": 6, + "x": 18, + "y": 3 + }, + "id": 44, + "links": [], + "options": { + "displayMode": "gradient", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "purple", + "value": null + } + ] + }, + "title": "$__cell_1" + }, + "limit": 20, + "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_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": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Seat allocation per party ", + "transparent": true, + "type": "bargauge" + }, + { + "cacheTimeout": null, + "content": "", + "datasource": null, + "gridPos": { + "h": 2, + "w": 2, + "x": 0, + "y": 10 + }, + "id": 51, + "links": [], + "mode": "markdown", + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "", + "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": "text" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#37872D" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 2, + "y": 10 + }, + "id": 50, + "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": "", + "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 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "0,1,2", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "Electors", + "value": "0" + } + ], + "valueName": "first" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#37872D" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 6, + "y": 10 + }, + "id": 60, + "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": "", + "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 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "0,1,2", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "Votes", + "value": "0" + } + ], + "valueName": "first" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#37872D" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 10, + "y": 10 + }, + "id": 52, + "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": "", + "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 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "0,1,2", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "Valid Votes", + "value": "0" + } + ], + "valueName": "first" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#37872D" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 14, + "y": 10 + }, + "id": 57, + "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": "", + "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 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "0,1,2", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "Rejected Votes", + "value": "0" + } + ], + "valueName": "first" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#37872D" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 2, + "x": 0, + "y": 12 + }, + "id": 62, + "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": "", + "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 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "0,1,2", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "Postal", + "value": "0" + } + ], + "valueName": "first" + }, + { + "datasource": null, + "gridPos": { + "h": 8, + "w": 4, + "x": 2, + "y": 12 + }, + "id": 46, + "options": { + "colorMode": "value", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "title": " " + }, + "overrides": [], + "values": false + }, + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal" + }, + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "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_pce2021_dashboard_area_map as areaMap\nWHERE \n areaMap.electionId = $rootElectionId\n and areaMap.administrativeDistrictId IN ($administrativeDistrictIds)\n\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": 8, + "w": 4, + "x": 6, + "y": 12 + }, + "id": 56, + "options": { + "colorMode": "value", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "title": " " + }, + "overrides": [], + "values": false + }, + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal" + }, + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "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": [ + [ + { + "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": 8, + "w": 4, + "x": 10, + "y": 12 + }, + "id": 48, + "options": { + "colorMode": "value", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "title": " " + }, + "overrides": [], + "values": false + }, + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal" + }, + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "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": [ + [ + { + "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": 8, + "w": 4, + "x": 14, + "y": 12 + }, + "id": 59, + "options": { + "colorMode": "value", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "title": " " + }, + "overrides": [], + "values": false + }, + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal" + }, + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "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": [ + [ + { + "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" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#37872D" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 2, + "x": 0, + "y": 14 + }, + "id": 54, + "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": "", + "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 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "0,1,2", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "Displaced", + "value": "0" + } + ], + "valueName": "first" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#37872D" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 2, + "x": 0, + "y": 16 + }, + "id": 61, + "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": "", + "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 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "0,1,2", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "Non Postal", + "value": "0" + } + ], + "valueName": "first" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#37872D" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 2, + "x": 0, + "y": 18 + }, + "id": 55, + "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": "", + "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 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "0,1,2", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "All", + "value": "0" + } + ], + "valueName": "first" + }, + { + "content": "", + "datasource": null, + "gridPos": { + "h": 2, + "w": 6, + "x": 9, + "y": 20 + }, + "id": 17, + "mode": "markdown", + "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" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "text" + } + ], + "refresh": "5m", + "schemaVersion": 22, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "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 = 'PROVINCIAL_COUNCIL_ELECTION_2021' 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 = 'PROVINCIAL_COUNCIL_ELECTION_2021' and parentElectionId IS NULL;", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": { + "tags": [], + "text": "01 - Colombo", + "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 = 'AdministrativeDistrict';", + "hide": 0, + "includeAll": false, + "index": -1, + "label": "Administrative District", + "multi": false, + "name": "administrativeDistrictIds", + "options": [ + { + "selected": true, + "text": "01 - Colombo", + "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 = 'AdministrativeDistrict';", + "refresh": 0, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "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 - Results - Administrative District", + "uid": "5ThAYmQGz", + "variables": { + "list": [] + }, + "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 new file mode 100644 index 00000000..7fbd596f --- /dev/null +++ b/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-provincial-counting.json @@ -0,0 +1,4505 @@ +{ + "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": 55, + "iteration": 1615979626464, + "links": [], + "panels": [ + { + "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": 3, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 27, + "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": "PROVINCIAL COUNTING DASHBOARD - ", + "prefixFontSize": "100%", + "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 \"Sri Lanka\"", + "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": "170%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "first" + }, + { + "content": "", + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 3 + }, + "id": 46, + "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": 4 + }, + "id": 79, + "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-35", + "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": 4 + }, + "id": 38, + "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": "AD", + "prefixFontSize": "50%", + "rangeMaps": [ + { + "from": "null", + "text": "N/A", + "to": "null" + } + ], + "sparkline": { + "fillColor": "#FADE2A", + "full": true, + "lineColor": "rgb(31, 120, 193)", + "show": true, + "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-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": [ + [ + { + "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": 9, + "y": 4 + }, + "id": 18, + "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": "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 + }, + "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-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": [ + [ + { + "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": 14, + "y": 4 + }, + "id": 8, + "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": "PV 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 + }, + "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-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": [ + [ + { + "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": 4 + }, + "id": 107, + "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": "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 + }, + "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-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": [ + [ + { + "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": 9, + "y": 5 + }, + "id": 109, + "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": "CC", + "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-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": [ + [ + { + "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": 14, + "y": 5 + }, + "id": 110, + "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": "PV CC", + "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-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": [ + [ + { + "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": 5 + }, + "id": 111, + "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": "DV CC", + "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-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": [ + [ + { + "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": 24, + "x": 0, + "y": 6 + }, + "id": 45, + "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": 7 + }, + "id": 80, + "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": "CE-201", + "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": 7 + }, + "id": 39, + "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 = \"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": [ + [ + { + "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": 9, + "y": 7 + }, + "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": "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 + }, + "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 = \"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": [ + [ + { + "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": 14, + "y": 7 + }, + "id": 9, + "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": "PV 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 + }, + "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 = \"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": [ + [ + { + "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": 7 + }, + "id": 108, + "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": "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 + }, + "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 = \"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": [ + [ + { + "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": 9, + "y": 8 + }, + "id": 112, + "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": "CC", + "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 = \"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": [ + [ + { + "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": 14, + "y": 8 + }, + "id": 113, + "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": "PV CC", + "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 = \"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": [ + [ + { + "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": 8 + }, + "id": 114, + "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": "DV CC", + "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 = \"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": [ + [ + { + "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": 24, + "x": 0, + "y": 9 + }, + "id": 47, + "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": 10 + }, + "id": 81, + "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-V1", + "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": 10 + }, + "id": 85, + "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-V1\"\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": 9, + "y": 10 + }, + "id": 84, + "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": "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 + }, + "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-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": [ + [ + { + "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": 14, + "y": 10 + }, + "id": 86, + "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": "PV 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 + }, + "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-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": [ + [ + { + "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": 10 + }, + "id": 115, + "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": "PV 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 + }, + "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-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": [ + [ + { + "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": 9, + "y": 11 + }, + "id": 93, + "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-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": [ + [ + { + "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": 14, + "y": 11 + }, + "id": 116, + "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-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": [ + [ + { + "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": 11 + }, + "id": 117, + "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-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": [ + [ + { + "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": 24, + "x": 0, + "y": 12 + }, + "id": 75, + "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": 13 + }, + "id": 15, + "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-4", + "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": 13 + }, + "id": 66, + "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-4\"\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" + }, + { + "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, + "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": 15 + }, + "id": 97, + "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-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", + "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": 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, + "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": 17 + }, + "id": 92, + "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-R2\"\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": 17 + }, + "id": 96, + "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-R2\"\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": 18 + }, + "id": 90, + "mode": "markdown", + "timeFrom": null, + "timeShift": null, + "title": "", + "type": "text" + }, + { + "content": "", + "datasource": null, + "gridPos": { + "h": 1, + "w": 14, + "x": 10, + "y": 18 + }, + "id": 104, + "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": 19 + }, + "id": 100, + "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-3", + "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": 19 + }, + "id": 102, + "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-3\"\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": 19 + }, + "id": 87, + "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-21", + "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": 19 + }, + "id": 91, + "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-21\"\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": 19 + }, + "id": 94, + "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-21\"\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": 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", + "schemaVersion": 22, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "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 = 'PROVINCIAL_COUNCIL_ELECTION_2021' 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 = 'PROVINCIAL_COUNCIL_ELECTION_2021' and parentElectionId IS NULL;", + "refresh": 1, + "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 - Counting - Provincial", + "uid": "GXrbHAVMkz", + "variables": { + "list": [] + }, + "version": 3 +} \ No newline at end of file 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 new file mode 100644 index 00000000..032d0d6f --- /dev/null +++ b/results-tabulation-dashboard/provincial-council-election-2021/provincial-election-2021-provincial-results.json @@ -0,0 +1,1587 @@ +{ + "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": 56, + "iteration": 1615980987350, + "links": [], + "panels": [ + { + "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": 3, + "w": 15, + "x": 0, + "y": 0 + }, + "id": 27, + "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": "ALL ISLAND RESULTS DASHBOARD", + "prefixFontSize": "70%", + "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 \"Sri Lanka\"", + "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": "150%", + "valueMaps": [ + { + "op": "=", + "text": "N/A", + "value": "null" + } + ], + "valueName": "first" + }, + { + "cacheTimeout": null, + "datasource": null, + "gridPos": { + "h": 20, + "w": 6, + "x": 18, + "y": 0 + }, + "id": 63, + "links": [], + "options": { + "displayMode": "gradient", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "purple", + "value": null + } + ] + }, + "title": "$__cell_1" + }, + "limit": 20, + "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_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": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Seat allocation per party ", + "transparent": true, + "type": "bargauge" + }, + { + "cacheTimeout": null, + "datasource": null, + "gridPos": { + "h": 7, + "w": 18, + "x": 0, + "y": 3 + }, + "id": 37, + "links": [], + "options": { + "displayMode": "gradient", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "yellow", + "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\", 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": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Top 10 parties", + "transparent": true, + "type": "bargauge" + }, + { + "cacheTimeout": null, + "content": "", + "datasource": null, + "gridPos": { + "h": 2, + "w": 2, + "x": 0, + "y": 10 + }, + "id": 51, + "links": [], + "mode": "markdown", + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "", + "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": "text" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#37872D" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 2, + "y": 10 + }, + "id": 50, + "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": "", + "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 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "0,1,2", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "Electors", + "value": "0" + } + ], + "valueName": "first" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#37872D" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 6, + "y": 10 + }, + "id": 60, + "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": "", + "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 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "0,1,2", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "Votes", + "value": "0" + } + ], + "valueName": "first" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#37872D" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 10, + "y": 10 + }, + "id": 52, + "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": "", + "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 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "0,1,2", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "Valid Votes", + "value": "0" + } + ], + "valueName": "first" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#37872D" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 14, + "y": 10 + }, + "id": 57, + "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": "", + "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 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "0,1,2", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "Rejected Votes", + "value": "0" + } + ], + "valueName": "first" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#37872D" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 2, + "x": 0, + "y": 12 + }, + "id": 62, + "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": "", + "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 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "0,1,2", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "Postal", + "value": "0" + } + ], + "valueName": "first" + }, + { + "datasource": null, + "gridPos": { + "h": 8, + "w": 4, + "x": 2, + "y": 12 + }, + "id": 46, + "options": { + "colorMode": "value", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "title": " " + }, + "overrides": [], + "values": false + }, + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal" + }, + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "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_pce2021_dashboard_area_map as areaMap\nWHERE \n areaMap.electionId = $rootElectionId\n\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": 8, + "w": 4, + "x": 6, + "y": 12 + }, + "id": 56, + "options": { + "colorMode": "value", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "title": " " + }, + "overrides": [], + "values": false + }, + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal" + }, + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "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": [ + [ + { + "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": 8, + "w": 4, + "x": 10, + "y": 12 + }, + "id": 48, + "options": { + "colorMode": "value", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "title": " " + }, + "overrides": [], + "values": false + }, + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal" + }, + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "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": [ + [ + { + "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": 8, + "w": 4, + "x": 14, + "y": 12 + }, + "id": 59, + "options": { + "colorMode": "value", + "fieldOptions": { + "calcs": [ + "mean" + ], + "defaults": { + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "title": " " + }, + "overrides": [], + "values": false + }, + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal" + }, + "pluginVersion": "6.7.3", + "targets": [ + { + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "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": [ + [ + { + "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" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#37872D" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 2, + "x": 0, + "y": 14 + }, + "id": 54, + "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": "", + "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 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "0,1,2", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "Displaced", + "value": "0" + } + ], + "valueName": "first" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#37872D" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 2, + "x": 0, + "y": 16 + }, + "id": 61, + "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": "", + "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 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "0,1,2", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "Non Postal", + "value": "0" + } + ], + "valueName": "first" + }, + { + "cacheTimeout": null, + "colorBackground": false, + "colorValue": true, + "colors": [ + "#37872D", + "#37872D", + "#37872D" + ], + "datasource": null, + "format": "none", + "gauge": { + "maxValue": 100, + "minValue": 0, + "show": false, + "thresholdLabels": false, + "thresholdMarkers": true + }, + "gridPos": { + "h": 2, + "w": 2, + "x": 0, + "y": 18 + }, + "id": 55, + "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": "", + "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 0;", + "refId": "A", + "select": [ + [ + { + "params": [ + "statusReportId" + ], + "type": "column" + } + ] + ], + "table": "dashboard_status_report", + "timeColumn": "createdAt", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "thresholds": "0,1,2", + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "singlestat", + "valueFontSize": "50%", + "valueMaps": [ + { + "op": "=", + "text": "All", + "value": "0" + } + ], + "valueName": "first" + }, + { + "content": "", + "datasource": null, + "gridPos": { + "h": 2, + "w": 6, + "x": 9, + "y": 20 + }, + "id": 17, + "mode": "markdown", + "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" + } + ] + } + ], + "timeFrom": null, + "timeShift": null, + "title": "", + "transparent": true, + "type": "text" + } + ], + "refresh": false, + "schemaVersion": 22, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "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 = 'PROVINCIAL_COUNCIL_ELECTION_2021' 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 = 'PROVINCIAL_COUNCIL_ELECTION_2021' and parentElectionId IS NULL;", + "refresh": 1, + "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 - Results - Provincial", + "uid": "YMS0mb7GzF", + "variables": { + "list": [] + }, + "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 diff --git a/results-tabulation-dashboard/provincial-council-election-2021/update-counting-dashboard-tables.sql b/results-tabulation-dashboard/provincial-council-election-2021/update-counting-dashboard-tables.sql new file mode 100644 index 00000000..b4be16fa --- /dev/null +++ b/results-tabulation-dashboard/provincial-council-election-2021/update-counting-dashboard-tables.sql @@ -0,0 +1,259 @@ +SET @election_template_name = "PROVINCIAL_COUNCIL_ELECTION_2021"; + +INSERT INTO ext_pce2021_dashboard_increment (active) VALUES(0); + +SET @lastIncrementId = LAST_INSERT_ID(); + + +INSERT INTO ext_pce2021_dashboard_tally_sheet_status (incrementId, electionId,provinceId, administrativeDistrictId, pollingDivisionId, + countingCentreId, templateName, voteType, partyId, verifiedTallySheetCount, releasedTallySheetCount, + emptyTallySheetCount, savedTallySheetCount, totalTallySheetCount) +SELECT + @lastIncrementId, + election.rootElectionId as electionId, + areaMap.provinceId, + areaMap.administrativeDistrictId, + areaMap.pollingDivisionId, + areaMap.countingCentreId, + template.templateName, + election.voteType, + metaData.metaDataValue as "partyId", + COUNT(IF(workflowInstance.status IN ("Verified", "Ready to Certify", "Certified", "Release Notified", "Released"), + tallySheet.tallySheetId, NULL)) AS verifiedTallySheetCount, + COUNT(IF(workflowInstance.status = "Released", tallySheet.tallySheetId, NULL)) AS releasedTallySheetCount, + COUNT(IF(workflowInstance.status = "Empty", tallySheet.tallySheetId, NULL)) AS emptyTallySheetCount, + COUNT(IF(workflowInstance.status = "Saved", tallySheet.tallySheetId, NULL)) AS savedTallySheetCount, + COUNT(tallySheet.tallySheetId) AS totalTallySheetCount +FROM + ext_pce2021_dashboard_area_map AS areaMap, + election, template, workflowInstance, + tallySheet left join metaData + on metaData.metaId = tallySheet.metaId and metaData.metaDataKey = "partyId" +WHERE + tallySheet.areaId = areaMap.countingCentreId + and election.electionId = tallySheet.electionId + and election.electionTemplateName = @election_template_name + and template.templateId = tallySheet.templateId + and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId +GROUP BY + election.rootElectionId, + areaMap.provinceId, + areaMap.administrativeDistrictId, + areaMap.pollingDivisionId, + areaMap.countingCentreId, + template.templateName, + election.voteType, + metaData.metaDataValue; + + + +INSERT INTO ext_pce2021_dashboard_tally_sheet_status (incrementId, electionId, provinceId, administrativeDistrictId, pollingDivisionId, + templateName, voteType, partyId, verifiedTallySheetCount, releasedTallySheetCount, + emptyTallySheetCount, savedTallySheetCount, totalTallySheetCount) +SELECT + @lastIncrementId, + election.rootElectionId as electionId, + areaMap.provinceId, + areaMap.administrativeDistrictId, + areaMap.pollingDivisionId, + template.templateName, + election.voteType, + metaData.metaDataValue as "partyId", + COUNT(IF(workflowInstance.status IN ("Verified", "Ready to Certify", "Certified", "Release Notified", "Released"), + tallySheet.tallySheetId, NULL)) AS verifiedTallySheetCount, + COUNT(IF(workflowInstance.status = "Released", tallySheet.tallySheetId, NULL)) AS releasedTallySheetCount, + COUNT(IF(workflowInstance.status = "Empty", tallySheet.tallySheetId, NULL)) AS emptyTallySheetCount, + COUNT(IF(workflowInstance.status = "Saved", tallySheet.tallySheetId, NULL)) AS savedTallySheetCount, + COUNT(tallySheet.tallySheetId) AS totalTallySheetCount +FROM + (SELECT provinceId, administrativeDistrictId, pollingDivisionId FROM ext_pce2021_dashboard_area_map + WHERE voteTYpe = "NonPostal" GROUP BY provinceId, administrativeDistrictId, pollingDivisionId) AS areaMap, + election, template, workflowInstance, + tallySheet left join metaData + on metaData.metaId = tallySheet.metaId and metaData.metaDataKey = "partyId" +WHERE + tallySheet.areaId = areaMap.pollingDivisionId + and election.electionId = tallySheet.electionId + and election.electionTemplateName = @election_template_name + and template.templateId = tallySheet.templateId + and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId +GROUP BY + election.rootElectionId, + areaMap.provinceId, + areaMap.administrativeDistrictId, + areaMap.pollingDivisionId, + template.templateName, + election.voteType, + metaData.metaDataValue; + + + +INSERT INTO ext_pce2021_dashboard_tally_sheet_status (incrementId, electionId, provinceId, + administrativeDistrictId, templateName, voteType, partyId, verifiedTallySheetCount, releasedTallySheetCount, + emptyTallySheetCount, savedTallySheetCount, totalTallySheetCount) +SELECT + @lastIncrementId, + election.rootElectionId as electionId, + areaMap.provinceId, + areaMap.administrativeDistrictId, + template.templateName, + election.voteType, + metaData.metaDataValue as "partyId", + COUNT(IF(workflowInstance.status IN ("Verified", "Ready to Certify", "Certified", "Release Notified", "Released"), + tallySheet.tallySheetId, NULL)) AS verifiedTallySheetCount, + COUNT(IF(workflowInstance.status = "Released", tallySheet.tallySheetId, NULL)) AS releasedTallySheetCount, + COUNT(IF(workflowInstance.status = "Empty", tallySheet.tallySheetId, NULL)) AS emptyTallySheetCount, + COUNT(IF(workflowInstance.status = "Saved", tallySheet.tallySheetId, NULL)) AS savedTallySheetCount, + COUNT(tallySheet.tallySheetId) AS totalTallySheetCount +FROM + (SELECT provinceId, administrativeDistrictId FROM ext_pce2021_dashboard_area_map + WHERE voteTYpe = "NonPostal" GROUP BY provinceId, administrativeDistrictId) AS areaMap, + election, template, workflowInstance, + tallySheet left join metaData + on metaData.metaId = tallySheet.metaId and metaData.metaDataKey = "partyId" +WHERE + tallySheet.areaId = areaMap.administrativeDistrictId + and election.electionId = tallySheet.electionId + and election.electionTemplateName = @election_template_name + and template.templateId = tallySheet.templateId + and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId +GROUP BY + election.rootElectionId, + areaMap.provinceId, + areaMap.administrativeDistrictId, + template.templateName, + election.voteType, + metaData.metaDataValue; + + + +INSERT INTO ext_pce2021_dashboard_party_wise_vote_results (incrementId, electionId, provinceId, administrativeDistrictId, + pollingDivisionId, countingCentreId, voteType, partyId, voteCount) +SELECT + @lastIncrementId, + countingCentreElection.rootElectionId AS electionId, + province.areaId AS provinceId, + administrativeDistrict.areaId AS administrativeDistrictId, + pollingDivision.areaId AS pollingDivisionId, + countingCentre.areaId AS countingCentreId, + countingCentreElection.voteType, + party.partyId, + (SELECT COALESCE(SUM(tallySheetVersionRow.numValue)) + FROM tallySheet, template, templateRow, workflowInstance, tallySheetVersionRow + WHERE + template.templateId = tallySheet.templateId + and templateRow.templateid = template.templateId + and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId + and tallySheetVersionRow.tallySheetVersionId = tallySheet.latestVersionId + and tallySheetVersionRow.templateRowId = templateRow.templateRowId + and workflowInstance.status IN ("Verified") + and templateRow.templateRowType = "PARTY_WISE_VOTE" + and template.templateName = "PCE-35" + and tallySheet.areaId = countingCentreId + and tallySheetVersionRow.partyId = party.partyId + ) AS voteCount +FROM ext_pce2021_dashboard_area_map AS areaMap, election_party AS electionParty, party, + area AS countingCentre, election AS countingCentreElection, area AS pollingDivision, area AS province, area AS administrativeDistrict +WHERE + countingCentre.areaId = areaMap.countingCentreId + and pollingDivision.areaId = areaMap.pollingDivisionId + and province.areaId = areaMap.provinceId + and administrativeDistrict.areaId = areaMap.administrativeDistrictId + and countingCentreElection.electionId = countingCentre.electionId + and countingCentreElection.electionTemplateName = @election_template_name + and electionParty.electionId = countingCentreElection.electionId + and party.partyId = electionParty.partyId; + + + +INSERT INTO ext_pce2021_dashboard_vote_results (incrementId, electionId, provinceId, administrativeDistrictId, + pollingDivisionId, countingCentreId, voteType, validVoteCount, rejectedVoteCount, voteCount) +SELECT + @lastIncrementId, + countingCentreElection.rootElectionId AS electionId, + province.areaId AS provinceId, + administrativeDistrict.areaId AS administrativeDistrictId, + pollingDivision.areaId AS pollingDivisionId, + countingCentre.areaId AS countingCentreId, + countingCentreElection.voteType, + COALESCE(SUM(voteCounts.validVoteCount), 0), + COALESCE(SUM(voteCounts.rejectedVoteCount), 0), + COALESCE(SUM(voteCounts.voteCount), 0) +FROM ext_pce2021_dashboard_area_map AS areaMap, + area AS countingCentre, election AS countingCentreElection, area AS pollingDivision, area AS province, area AS administrativeDistrict, + (SELECT + tallySheet.areaId AS countingCentreId, + SUM(IF(templateRow.templateRowType = "PARTY_WISE_VOTE",tallySheetVersionRow.numValue,0)) validVoteCount, + SUM(IF(templateRow.templateRowType = "REJECTED_VOTE",tallySheetVersionRow.numValue,0)) rejectedVoteCount, + SUM(tallySheetVersionRow.numValue) voteCount + FROM tallySheet, template, templateRow, workflowInstance, tallySheetVersionRow + WHERE + template.templateId = tallySheet.templateId + and templateRow.templateid = template.templateId + and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId + and tallySheetVersionRow.tallySheetVersionId = tallySheet.latestVersionId + and tallySheetVersionRow.templateRowId = templateRow.templateRowId + and workflowInstance.status IN ("Verified") + and templateRow.templateRowType IN ("PARTY_WISE_VOTE", "REJECTED_VOTE") + and template.templateName = "PCE-35" + GROUP BY tallySheet.areaId + ) AS voteCounts +WHERE + countingCentre.areaId = areaMap.countingCentreId + and pollingDivision.areaId = areaMap.pollingDivisionId + and province.areaId = areaMap.provinceId + and administrativeDistrict.areaId = areaMap.administrativeDistrictId + and countingCentreElection.electionId = countingCentre.electionId + and voteCounts.countingCentreId = countingCentre.areaId + and countingCentreElection.electionTemplateName = @election_template_name +GROUP BY + countingCentreElection.rootElectionId, + province.areaId, + administrativeDistrict.areaId, + pollingDivision.areaId, + countingCentre.areaId, + countingCentreElection.voteType; + + + +INSERT INTO ext_pce2021_dashboard_party_wise_seat_allocation (incrementId, electionId, provinceId, administrativeDistrictId, partyId, seatCount) +SELECT + @lastIncrementId, + administrativeDistrictElection.rootElectionId AS provinceElectionId, + administrativeDistrict.areaId AS administrativeDistrictId, +-- provinceElection.rootElectionId AS electionId, + province.areaId AS provinceId, + party.partyId, + (SELECT COALESCE(SUM(tallySheetVersionRow.numValue), 0) + FROM tallySheet, template, templateRow, workflowInstance, tallySheetVersionRow + WHERE + template.templateId = tallySheet.templateId + and templateRow.templateid = template.templateId + and workflowInstance.workflowInstanceId = tallySheet.workflowInstanceId + and tallySheetVersionRow.tallySheetVersionId = tallySheet.latestVersionId + and tallySheetVersionRow.templateRowId = templateRow.templateRowId + and workflowInstance.status IN ("Verified", "Ready to Certify", "Certified", "Release Notified", "Released") + and templateRow.templateRowType = "TEMPLATE_ROW_TYPE_SEATS_ALLOCATED" + and template.templateName = "PCE-R2" + and tallySheet.areaId = areaMap.administrativeDistrictId + and tallySheetVersionRow.partyId = party.partyId + ) AS seatCount +FROM + (SELECT ext_pce2021_dashboard_area_map.administrativeDistrictId,ext_pce2021_dashboard_area_map.provinceId + FROM ext_pce2021_dashboard_area_map GROUP BY ext_pce2021_dashboard_area_map.provinceId,ext_pce2021_dashboard_area_map.administrativeDistrictId) AS areaMap, + area AS administrativeDistrict, area AS province, election AS administrativeDistrictElection, election_party AS electionParty, party +WHERE + administrativeDistrict.areaId = areaMap.administrativeDistrictId + and administrativeDistrictElection.electionId = administrativeDistrict.electionId + and administrativeDistrictElection.electionTemplateName = @election_template_name + and electionParty.electionId = administrativeDistrictElection.electionId + and party.partyId = electionParty.partyId +GROUP BY administrativeDistrictElection.electionId, administrativeDistrict.areaId, party.partyId; + + + +UPDATE ext_pce2021_dashboard_increment SET active = 1 WHERE id = @lastIncrementId; +DELETE FROM ext_pce2021_dashboard_tally_sheet_status WHERE incrementId < @lastIncrementId; +DELETE FROM ext_pce2021_dashboard_party_wise_vote_results WHERE incrementId < @lastIncrementId; +DELETE FROM ext_pce2021_dashboard_vote_results WHERE incrementId < @lastIncrementId; +DELETE FROM ext_pce2021_dashboard_party_wise_seat_allocation WHERE incrementId < @lastIncrementId; diff --git a/results-tabulation-dashboard/requirements.txt b/results-tabulation-dashboard/requirements.txt index c930e11b..faa1072d 100644 --- a/results-tabulation-dashboard/requirements.txt +++ b/results-tabulation-dashboard/requirements.txt @@ -8,7 +8,7 @@ chardet==3.0.4 Click==7.0 clickclick==1.2.2 connexion==2.2.0 -cryptography==3.2 +cryptography==3.3.2 decorator==4.4.0 docopt==0.6.2 ecdsa==0.15 diff --git a/results-tabulation-ui/src/components/election/extended-election/ProvincialCouncilElection2021/index.js b/results-tabulation-ui/src/components/election/extended-election/ProvincialCouncilElection2021/index.js index 4aad374a..2bda42b1 100644 --- a/results-tabulation-ui/src/components/election/extended-election/ProvincialCouncilElection2021/index.js +++ b/results-tabulation-ui/src/components/election/extended-election/ProvincialCouncilElection2021/index.js @@ -144,8 +144,8 @@ export default class ExtendedElectionProvincialCouncilElection2021 extends Exten "Seat Allocation 1", "Bonus Seat Allocation 1", "Bonus Seat Allocation 2", - "Seat Allocation 2", - "Candidates List" + "Seat Allocation (Votes + Seats)", + "Members List" ]; return tallySheetCodes.map((tallySheetCode, tallySheetCodeIndex) => {