Property Tax - National Dashboard
Technical Document
Technical Document
NDSS has two sides to it. One is the process in which the data is pooled to the ElasticSearch and the other is the way it is fetched, aggregated, computed, transformed and sent across.
As this revolves around a variety of data sets, there is a need for making this configurable. This ensures that the process can be configured easily in case a new scenario is introduced.
This document walks us through the steps on how to define the configurations for DSS analytics for Property Tax module.
Analytics: A microservice responsible for building, fetching, aggregating and computing the Data on ElasticSearch to a consumable data response. This is later used for visualizations and graphical representations.
Analytics Configurations: Analytics contains multiple configurations. We need to add the changes related to National Dashboard in this dashboard analytics. Dashboard analytics configuration file path: configs/egov-dss-dashboards/dashboard-analytics at qa · egovernments/configs Below is a list of configurations that need to be changed to run the National Dashboard successfully.
Chart API Configuration
Master Dashboard Configuration
Role Dashboard Mappings Configuration
Chart API Configuration: Each visualization has its own properties. Each visualization comes from different data sources (sometimes it is a combination of different data sources). In order to configure each visualization and its properties, we have a Chart API Configuration Document.
In this, Visualization Code, which happens to be the key, has its properties configured as a part of the configuration and is easily changeable.
Sample ChartApiConfiguration.json data for the Property Tax below.
"_comment": "NSS-PROPERTYTAX",
"todaysCollectionv3": {
"chartName": "NATIONAL_DSS_TODAYS_COLLECTION",
"queries": [
{
"module": "PT",
"dateRefField": "",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "pt-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{}},\"aggs\":{\"todaysDate\":{\"terms\":{\"field\":\"date\",\"order\":{\"_term\":\"desc\"},\"size\":1},\"aggs\":{\"Todays Collection\":{\"sum\":{\"field\":\"todaysCollectionForUsageCategory\"}}}},\"lastUpdatedTime\":{\"terms\":{\"field\":\"lastModifiedTime\",\"order\":{\"_term\":\"desc\"},\"size\":1}}}}}}"
}
],
"chartType": "metric",
"valueType": "Amount",
"drillChart": "none",
"documentType": "_doc",
"action": "",
"TodaysCollection":true,
"aggregationPaths": [
"Todays Collection"
],
"insight": {
},
"_comment": " "
},
"totalCollectionv3": {
"chartName": "NATIONAL_DSS_TOTAL_COLLECTION",
"queries": [
{
"module": "PT",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "pt-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"todaysCollectionForUsageCategory\"}}}}}}"
}
],
"chartType": "metric",
"valueType": "Amount",
"drillChart": "none",
"documentType": "_doc",
"action": "",
"aggregationPaths": [
"Total Collection"
],
"insight": {
"chartResponseMap" : "totalCollectionv3",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "year",
"isRoundOff": true
},
"_comment": " "
},
"targetCollectionv3": {
"chartName": "NATIONAL_DSS_TARGET_COLLECTION",
"queries": [
{
"module": "MASTER",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"dateRefField": "date",
"indexName": "master-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must\":[{\"term\":{\"module.keyword\":\"PT\"}}]}},\"aggs\":{\"Target Collection\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}"
}
],
"chartType": "metric",
"valueType": "amount",
"action": "",
"drillChart": "none",
"documentType": "_doc",
"aggregationPaths": [
"Target Collection"
],
"isDayUnit": true,
"postAggregationTheory" : "repsonseToDifferenceOfDates",
"insight": {
"chartResponseMap" : "targetCollectionv3",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "year",
"isRoundOff": true
},
"_comment": " "
},
"targetAchievedv3": {
"chartName": "NATIONAL_DSS_TARGET_ACHIEVED",
"queries": [
{
"module": "MASTER",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"dateRefField": "date",
"indexName": "master-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must\":[{\"term\":{\"module.keyword\":\"PT\"}}]}},\"aggs\":{\"Actual collection\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}"
},
{
"module": "PT",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "pt-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{}},\"aggs\":{\"Total Collection\":{\"sum\":{\"field\":\"todaysCollectionForUsageCategory\"}}}}}}"
}
],
"chartType": "metric",
"valueType": "percentage",
"drillChart": "none",
"documentType": "_doc",
"action": "percentage",
"isRoundOff": true,
"preActionTheory":{
"Actual collection":"repsonseToDifferenceOfDates"
},
"aggregationPaths": [
"Total Collection",
"Actual collection"
],
"insight": {
"chartResponseMap" : "targetAchievedv3",
"action" : "differenceOfNumbers",
"upwardIndicator" : "positive",
"downwardIndicator" : "negative",
"textMessage" : "$indicator$value% than last $insightInterval",
"colorCode" : "#228B22",
"insightInterval" : "year",
"isRoundOff": true
},
"_comment": " "
},
"cumulativeCollectionv3": {
"chartName": "NATIONAL_DSS_TOTAL_CUMULATIVE_COLLECTION",
"queries": [
{
"module": "PT",
"dateRefField": "date",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"indexName": "pt-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{}},\"aggs\":{\"Collections\":{\"date_histogram\":{\"field\":\"date\",\"interval\":\"intervalvalue\"},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"todaysCollectionForUsageCategory\"}}}}}}}}"
}
],
"chartType": "line",
"valueType": "amount",
"action": "",
"drillChart": "none",
"documentType": "_doc",
"aggregationPaths": [
"Collections"
],
"isCumulative": true,
"interval": "month",
"insight": {
},
"_comment": " "
},
"topPerformingStatesv3": {
"chartName": "NATIONAL_DSS_PT_TOP_3_PERFORMING_STATES_TARGET_ACHIEVEMENT",
"queries": [
{
"module": "MASTER",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"dateRefField": "date",
"indexName": "master-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must\":[{\"term\":{\"module.keyword\":\"PT\"}}]}},\"aggs\":{\"Target Collection\":{\"terms\":{\"field\":\"state.keyword\",\"size\":\"200\",\"order\":{\"Sum\":\"desc\"}},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}}}"
},
{
"module": "PT",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"dateRefField": "date",
"indexName": "pt-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{}},\"aggs\":{\"Total Collection\":{\"terms\":{\"field\":\"state.keyword\",\"size\":\"200\",\"order\":{\"Sum\":\"desc\"}},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"todaysCollectionForUsageCategory\"}}}}}}}}"
}
],
"chartType": "perform",
"valueType": "percentage",
"drillChart": "none",
"documentType": "_doc",
"action": "percentage",
"plotLabel": "NATIONAL_DSS_TARGET_ACHIEVED",
"order": "desc",
"limit": 3,
"isRoundOff": true,
"aggregationPaths": [
"Total Collection","Target Collection"
],
"preActionTheory":{
"Target Collection":"repsonseToDifferenceOfDates"
},
"insight": {
},
"_comment": " Top Performing Ulbs for target achieved"
},
"bottomPerformingStatesv3": {
"chartName": "NATIONAL_DSS_PT_BOTTOM_3_PERFORMING_STATES_TARGET_ACHIEVEMENT",
"queries": [
{
"module": "MASTER",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"dateRefField": "date",
"indexName": "master-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{\"must\":[{\"term\":{\"module.keyword\":\"PT\"}}]}},\"aggs\":{\"Target Collection\":{\"terms\":{\"field\":\"state.keyword\",\"size\":\"200\",\"order\":{\"Sum\":\"asc\"}},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}}}"
},
{
"module": "PT",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"dateRefField": "date",
"indexName": "pt-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{}},\"aggs\":{\"Total Collection\":{\"terms\":{\"field\":\"state.keyword\",\"size\":\"200\",\"order\":{\"Sum\":\"asc\"}},\"aggs\":{\"Sum\":{\"sum\":{\"field\":\"todaysCollectionForUsageCategory\"}}}}}}}}"
}
],
"chartType": "perform",
"valueType": "percentage",
"drillChart": "none",
"documentType": "_doc",
"action": "percentage",
"plotLabel": "NATIONAL_DSS_TARGET_ACHIEVED",
"order": "asc",
"limit": 3,
"isRoundOff": true,
"aggregationPaths": [
"Total Collection", "Target Collection"
],
"preActionTheory":{
"Target Collection":"repsonseToDifferenceOfDates"
},
"insight": {
},
"_comment": " Bottom Performing Ulbs for target achieved"
},
"collectionByUsageTypev3": {
"chartName": "NATIONAL_DSS_PT_COLLECTION_BY_USAGE_TYPE",
"queries": [
{
"module": "PT",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"dateRefField": "date",
"indexName": "pt-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{}},\"aggs\":{\"Usage Type\":{\"terms\":{\"field\":\"usageCategory.keyword\",\"size\":200},\"aggs\":{\"Amount Paid\":{\"sum\":{\"field\":\"todaysCollectionForUsageCategory\"}}}}}}}}"
}
],
"chartType": "pie",
"valueType": "amount",
"action": "",
"documentType": "_doc",
"drillChart": "none",
"aggregationPaths": [
"Usage Type"
],
"insight": {
},
"_comment": " collection/amount per usage type"
},
"demandCollectionIndexStatesRevenuev3": {
"chartName": "NATIONAL_DSS_PT_KEY_FY_INDICATORS",
"queries": [
{
"module": "PT",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"dateRefField": "date",
"indexName": "pt-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{}},\"aggs\":{\"state \":{\"terms\":{\"field\":\"state.keyword\",\"size\":200},\"aggs\":{\"PT_Total_Collection\":{\"sum\":{\"field\":\"todaysCollectionForUsageCategory\"}},\"PT_Transactions\":{\"sum\":{\"field\":\"transactionsForUsageCategory\"}},\"PT_Assessed_Properties\":{\"sum\":{\"field\":\"assessedPropertiesForUsageCategory\"}}}}}}}}"
},
{
"module": "MASTER",
"requestQueryMap": "{\"state\" : \"state.keyword\",\"ulb\" : \"ulb.keyword\"}",
"dateRefField": "date",
"indexName": "master-national-dashboard",
"aggrQuery": "{\"aggs\":{\"AGGR\":{\"filter\":{\"bool\":{}},\"aggs\":{\"state \":{\"terms\":{\"field\":\"state.keyword\",\"size\":200},\"aggs\":{\"PT_Target_Collection\":{\"filter\":{\"term\":{\"module.keyword\":\"PT\"}},\"aggs\":{\"sum\":{\"sum\":{\"field\":\"budgetProposedForMunicipalCorporation\"}}}}}}}}}}"
}
],
"isMdmsEnabled": false,
"filterKeys": [
{"key": "state", "column": "State"}
],
"chartType": "xtable",
"valueType": "number",
"drillChart": "demandCollectionIndexUlbRevenuev3",
"action": "",
"plotLabel": "State",
"isPostResponseHandler": true,
"postAggregationTheory" : "repsonseToDifferenceOfDates",
"aggregationPaths": [
"PT_Total_Collection",
"PT_Transactions",
"PT_Assessed_Properties",
"PT_Target_Collection"
],
"computedFields": [
{
"postAggregationTheory" : "repsonseToDifferenceOfDates",
"actionName": "AdditiveComputedField",
"fields" : ["PT_Target_Collection"],