{"title":"Create KPI based on Expressions","url":"https://docs.vismasoftware.no/onestopreporting/reporting/reports/report-designer/creating-reports/expressions-and-kpis/examples-use-of-expressions-and-kpis/combine-expressions-income-and-cogs-in-the-kpi-grossmargin/","link":"/onestopreporting/reporting/reports/report-designer/creating-reports/expressions-and-kpis/examples-use-of-expressions-and-kpis/combine-expressions-income-and-cogs-in-the-kpi-grossmargin/","description":"Combine saved expressions with mathematical formulas to calculate advanced business metrics.","content":"\u003cp\u003eIn this example, we create a KPI that shows gross margin in %. This KPI will be based on the expressions \u003cem\u003eINCOME\u003c/em\u003e and \u003cem\u003eCOGS\u003c/em\u003e.\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cp\u003eIn the \u003cstrong\u003eReport Designer\u003c/strong\u003e menu, select \u003cstrong\u003eKPIs\u003c/strong\u003e and then \u003cstrong\u003eManage KPIs\u003c/strong\u003e.\u003c/p\u003e\n\u003cp\u003e\u003cimg src=\"/onestopreporting/reporting/reports/report-designer/creating-reports/expressions-and-kpis/examples-use-of-expressions-and-kpis/combine-expressions-income-and-cogs-in-the-kpi-grossmargin/img/en/test.png\"\u003e\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eIn the dialog that opens, click \u003cstrong\u003eNew\u003c/strong\u003e.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eIn the next dialog, enter a KPI group name (in the example \u003cem\u003eFinancial KPIs\u003c/em\u003e). You can also add a description.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eClick \u003cstrong\u003eAdd\u003c/strong\u003e and enter a name of the KPI; \u003cem\u003eGROSS MARGIN %\u003c/em\u003e. You may also enter a comment.\u003c/p\u003e\n\u003cp\u003e\u003cimg src=\"/onestopreporting/reporting/reports/report-designer/creating-reports/expressions-and-kpis/examples-use-of-expressions-and-kpis/combine-expressions-income-and-cogs-in-the-kpi-grossmargin/img/en/image-2.png\"\u003e\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eThis KPI will be based on expressions, so make sure that the \u003cstrong\u003eBased on Expressions\u003c/strong\u003e option is selected.\u003c/p\u003e\n\u003cp\u003eNext, you must indicate which measure the expressions that will be included in the KPI are based on.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eClick the \u003cstrong\u003eEdit measure\u003c/strong\u003e button in the \u003cem\u003eMeasure\u003c/em\u003e box.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eFind and select the measure that the expressions \u003cem\u003eINCOME\u003c/em\u003e and \u003cem\u003eCOGS\u003c/em\u003e are based on. In our case, this is \u003cstrong\u003eNet Amount\u003c/strong\u003e (under \u003cem\u003eGeneral Ledger Transactions)\u003c/em\u003e.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eClick \u003cstrong\u003eOK\u003c/strong\u003e to confirm.\u003c/p\u003e\n\u003cp\u003e\u003cimg src=\"/onestopreporting/reporting/reports/report-designer/creating-reports/expressions-and-kpis/examples-use-of-expressions-and-kpis/combine-expressions-income-and-cogs-in-the-kpi-grossmargin/img/en/image-3.png\"\u003e\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eClick the \u003cstrong\u003eEdit\u003c/strong\u003e button in the \u003cstrong\u003eFormula\u003c/strong\u003e field.\u003c/p\u003e\n\u003cp\u003e\u003cimg src=\"/onestopreporting/reporting/reports/report-designer/creating-reports/expressions-and-kpis/examples-use-of-expressions-and-kpis/combine-expressions-income-and-cogs-in-the-kpi-grossmargin/img/en/image-4.png\"\u003e\u003c/p\u003e\n\u003cp\u003eThe \u003cstrong\u003eKPI Editor\u003c/strong\u003e opens:\u003c/p\u003e\n\u003ctable\u003e\n  \u003cthead\u003e\n      \u003ctr\u003e\n          \u003cth\u003e\u003c/th\u003e\n          \u003cth\u003e\u003cstrong\u003eName\u003c/strong\u003e\u003c/th\u003e\n      \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n      \u003ctr\u003e\n          \u003ctd\u003e1\u003c/td\u003e\n          \u003ctd\u003eExpressions\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003e2\u003c/td\u003e\n          \u003ctd\u003e\u003cstrong\u003eFormula\u003c/strong\u003e area\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003e3\u003c/td\u003e\n          \u003ctd\u003e\u003cstrong\u003eOperators\u003c/strong\u003e area\u003c/td\u003e\n      \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003eThe KPI \u003cem\u003eGROSS MARGIN %\u003c/em\u003e will consist of the expression \u003cem\u003eINCOME\u003c/em\u003e minus the expression \u003cem\u003eCOGS\u003c/em\u003e divided by \u003cem\u003eINCOME\u003c/em\u003e to get the result in percent.\u003c/p\u003e\n\u003cp\u003eThe formula will look as shown in the figure below:\u003c/p\u003e\n\u003cp\u003e\u003cimg src=\"/onestopreporting/reporting/reports/report-designer/creating-reports/expressions-and-kpis/examples-use-of-expressions-and-kpis/combine-expressions-income-and-cogs-in-the-kpi-grossmargin/img/en/image-6.png\"\u003e\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eTo build the formula, perform the following steps:\u003c/p\u003e\n\u003cp\u003ea. In the \u003cstrong\u003eOperators\u003c/strong\u003e section, click \u003cstrong\u003e(\u003c/strong\u003e (left parenthesis) twice.\u003c/p\u003e\n\u003cp\u003eb. Drag the expression \u003cem\u003eINCOME\u003c/em\u003e into the \u003cstrong\u003eFormula\u003c/strong\u003e area*.*\u003c/p\u003e\n\u003cp\u003ec. In the \u003cstrong\u003eOperators\u003c/strong\u003e area, click \u003cstrong\u003e*\u003c/strong\u003e (multiply by) and type -1. This is to convert the income amounts that are negative in the ERP system into positives so that the entities that will be calculated are both positive in order to give the correct result.\u003c/p\u003e\n\u003cp\u003ed. In the \u003cstrong\u003eOperators\u003c/strong\u003e area, click \u003cstrong\u003e)\u003c/strong\u003e (right parenthesis).\u003c/p\u003e\n\u003cp\u003ee. In the \u003cstrong\u003eOperators\u003c/strong\u003e area, click \u003cstrong\u003e\u0026ndash;\u003c/strong\u003e (minus).\u003c/p\u003e\n\u003cp\u003ef. Drag the expression \u003cem\u003eCOGS\u003c/em\u003e into the \u003cstrong\u003eFormula\u003c/strong\u003e area*.*\u003c/p\u003e\n\u003cp\u003eg. In the \u003cstrong\u003eOperators\u003c/strong\u003e area, click \u003cstrong\u003e)\u003c/strong\u003e (right parenthesis).\u003c/p\u003e\n\u003cp\u003eh. In the operation section, click \u003cstrong\u003e/\u003c/strong\u003e (divide by).\u003c/p\u003e\n\u003cp\u003ei. Drag the expression \u003cem\u003eINCOME\u003c/em\u003e into the \u003cstrong\u003eFormula\u003c/strong\u003e area.\u003c/p\u003e\n\u003cp\u003ej. In the \u003cstrong\u003eOperators\u003c/strong\u003e area, click \u003cstrong\u003e*\u003c/strong\u003e (multiply by) and type -1. (Again to convert the income amounts into positives.)\u003c/p\u003e\n\u003cp\u003ek. In the \u003cstrong\u003eOperator\u003c/strong\u003e section, click \u003cstrong\u003e)\u003c/strong\u003e (right parenthesis).\u003c/p\u003e\n\u003cp\u003el. Click \u003cstrong\u003eOK\u003c/strong\u003e to confirm.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eClick \u003cstrong\u003eOK\u003c/strong\u003e and then \u003cstrong\u003eClose\u003c/strong\u003e to exit the \u003cstrong\u003eKPI\u003c/strong\u003e dialog.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n","children":[]}