Last post Jun 28, 2018 10:03 AM by Deepak Panchal
Jun 27, 2018 08:21 AM|shuaib.k.khan|LINK
please help with the calculation of growth% in reportviewer (visual studio)
the sheet linked with SQL server. we have a location wise sales data and we want to compare like-for-like sales growth in the same report
I have run a query with date filters and convert date into year as mentioned below so how can I calculate the %growth between these two sales figure
i am working on visual studio reportviewer
Jun 28, 2018 10:03 AM|Deepak Panchal|LINK
I suggest you to calculate the growth in SQL query and use the same query in SSRS report.
You can refer the query below as an example.
ITH SalePercentage_cte AS (
ROW_NUMBER() OVER(PARTITION BY ProductName,SalesYear ORDER BY ProductName,SalesYear, SalesMonth) rn,
CAST(( ( s1.Sales - s2.Sales ) / s2.Sales ) * 100.0 AS DECIMAL(7, 2)) AS Percentage
FROM SalePercentage_cte AS s1
LEFT JOIN SalePercentage_cte s2
ON s1.rn = s2.rn + 1
AND s1.ProductName = s2.ProductName
AND s1.SalesYear = s2.SalesYear
How to calculate the increasing percentage of sales each month using T-SQL
Further, you can try to modify the query to get expected result.