--- title: "KPI and Sparkline (Report element)" slug: "kpi-and-sparkline-report-element" updated: 2025-01-06T17:02:08Z published: 2025-01-06T17:02:08Z canonical: "docs.mapp.com/kpi-and-sparkline-report-element" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # KPI and Sparkline (Report element) Metrics and Formulas can be shown in a report as "Single KPI" or "Sparkline." "Single KPI" shows the total number, while "Sparkline" shows the daily development. ![](https://cdn.document360.io/554b9b98-6720-4d8b-9919-c7b203d72648/Images/Documentation/CleanShot 2024-05-23 at 16.53.43@2x.png) ![](https://cdn.document360.io/554b9b98-6720-4d8b-9919-c7b203d72648/Images/Documentation/CleanShot 2024-05-23 at 16.53.06@2x.png) ## Creation and copying of the configuration 1. Add a KPI/Sparkline to a report. Learn more about it in the training chapter. 2. Finish the configuration. 3. In the report edit mode, click “Copy JSON configuration”. ![](https://cdn.document360.io/554b9b98-6720-4d8b-9919-c7b203d72648/Images/Documentation/CleanShot 2024-05-23 at 16.56.45@2x(1).png) ## Example Call ```json {    "resultType": "DATA_ONLY",    "queryObject": {        "type": "KPI",        "metricName": "pages_pageImpressions",        "dimensionName": "time_days",        "predefinedContainer": {            "filters": [                {                    "name": "time_range",                    "connector": "AND",                    "filterPredicate": "BETWEEN",                    "value1": "2020-10-14 00:00:00",                    "value2": "2020-11-11 00:00:00",                    "context": "NONE",                    "caseSensitive": false                }            ],            "containers": []        }    } } ``` ### KPI Response Sample KPI response ```json {    "calculationDataType": "RAW_DATA",    "rows": [        [            "0000000000", //            1306 // -> page Impressions        ]    ],    "rowCount": 1,    "rowCountTotal": 1,    "headers": [        {            "alias": "time_id_categories_t_year_month_day|0",            "arrangeType": "time_id_categories_t_year_month_day",            "sumPositions": [                0            ],            "name": "time_days",            "metric": false,            "dimension": true        },        {            "alias": "page_impressions|0",            "arrangeType": "page_impressions",            "name": "pages_pageImpressions",            "metric": true,            "dimension": false,            "sortIndex": 1,            "sortDirection": "DESCENDING"        }    ],    "columnCount": 2,    "warnings": [],    "information": [],    "timerange": [        "2020-10-14 00:00:00",        "2020-11-11 00:00:00"    ],    "timestamp": "2022-10-18T15:35:45.404+0200" } ``` ## KPI Comparison Call ![](https://cdn.document360.io/554b9b98-6720-4d8b-9919-c7b203d72648/Images/Documentation/ceb130f8-6608-434d-a526-150e4113f485.png) KPI Comparison Call ```json {    "resultType": "DATA_ONLY",    "queryObject": {        "type": "KPI",        "metricName": "pages_pageImpressions",        "dimensionName": "time_days",        "predefinedContainer": {            "filters": [                {                    "name": "time_range",                    "connector": "AND",                    "filterPredicate": "BETWEEN",                    "value1": "2020-10-14 00:00:00",                    "value2": "2020-11-11 00:00:00",                    "context": "NONE",                    "caseSensitive": false                }            ],            "containers": []        },        "comparison": {            "type": "PERIOD",            "filter": {                "name": "time_range",                "value1": "2022-03-02 00:00:00",                "value2": "2022-03-06 00:00:00",                "filterPredicate": "BETWEEN",                "connector": "AND",                "context": "NONE",                "caseSensitive": false            }    } } } ``` ### KPI Comparison Response Sample KPI Comparison Response ```json {    "calculationDataType": "RAW_DATA",    "rows": [        [            "000000000"  // -> Total row indication 1306,   // -> Page Impressions KPI time range            1502 // -> Page Impressions comparison time range        ]    ],    "rowCount": 1,    "rowCountTotal": 1,    "headers": [        {            "alias": "time_id_categories_t_year_month_day|0",  // -> Dimension Column for position of TOTAL (footer)            "arrangeType": "time_id_categories_t_year_month_day",            "sumPositions": [                0            ],            "name": "time_days",            "metric": false,            "dimension": true        },        {            "alias": "page_impressions|0", // -> Page Impressions KPI time range            "arrangeType": "page_impressions",            "name": "pages_pageImpressions",            "metric": true,            "dimension": false,            "sortIndex": 1,            "sortDirection": "DESCENDING"        },        {            "alias": "page_impressions|1", // -> Page Impressions comparison time range            "arrangeType": "page_impressions", "name": "pages_pageImpressions",            "metric": true,            "dimension": false        }    ],    "columnCount": 3,    "warnings": [],    "information": [],    "timerange": [        "2020-10-14T00:00:00.000+0200",        "2020-11-11T00:00:00.000+0100"    ],    "timestamp": "2022-10-19T10:03:21.351+0200" } ``` ## Sparkline Call ![](https://cdn.document360.io/554b9b98-6720-4d8b-9919-c7b203d72648/Images/Documentation/442b8366-d022-4655-a0a5-17278e37230b.png) Sparkline Call ```json {    "resultType": "DATA_ONLY",    "queryObject": {        "type": "SPARKLINE",        "metricName": "pages_pageImpressions",        "dimensionName": "time_days",        "predefinedContainer": {            "filters": [                {                    "name": "time_range",                    "connector": "AND",                    "filterPredicate": "BETWEEN",                    "value1": "2020-10-14 00:00:00",                    "value2": "2020-11-11 00:00:00",                    "context": "NONE",                    "caseSensitive": false                }            ],            "containers": []        }    } } ``` ### Sparkline Response Sample Sparkline Response ```json {    "calculationDataType": "RAW_DATA",    "rows": [ // -> Sparkline Data Points        [            "20201014",            408        ],        [            "20201015",            148        ],        ...        [            "0000000000",            1306        ]    ],    "rowCount": 29,    "rowCountTotal": 28,    "headers": [        {            "alias": "time_id_categories_t_year_month_day|0",              "arrangeType": "time_id_categories_t_year_month_day",            "sumPositions": [                28            ],            "name": "time_days",            "metric": false,            "dimension": true,            "sortIndex": 1,            "sortDirection": "ASCENDING"        },        {            "alias": "page_impressions|0",            "arrangeType": "page_impressions",            "name": "pages_pageImpressions",            "metric": true,            "dimension": false        }    ],    "columnCount": 2,    "information": [],    "warnings": [],    "timerange": [        "2020-10-14 00:00:00",        "2020-11-11 00:00:00"    ],    "timestamp": "2022-10-18T15:31:31.871+0200" } ```