SQLServerCentral » Article Discussions » Article Discussions by Author » Discuss content posted by Ryan » Calculating Percentage ChangeInstantForum 2016-2 FinalSQLServerCentralhttps://www.sqlservercentral.com/Forums/SQLServerCentralSun, 23 Apr 2017 14:09:13 GMT20Calculating Percentage Changehttps://www.sqlservercentral.com/Forums/FindPost403781.aspxComments posted to this topic are about the item [B]<A HREF="/scripts/Miscellaneous/31868/">Calculating Percentage Change</A>[/B]Mon, 04 Jul 2011 09:28:48 GMTRyanRE: Calculating Percentage Changehttps://www.sqlservercentral.com/Forums/FindPost1136060.aspxHi. I am working on a report, using SRSS, where I need to compute for the percentage change for the current fortnight versus the previous fortnight. The date range of the current fortnight is a parameter setting. Thus the previous fortnight is dependent on this current date range. To illustrate:
Current fortnight: June 20, 2011 to July 3, 2011 (parametized)
Item Count
-------------
A 5
B 3
C 11
D 2
E 0
Previous fortnight: June 6, 2011 to June 19, 2011
Item Count
-------------
A 4
B 1
C 13
D 2
E 6
Thus the resulting values I need to see are as follows:
Item % Change
-------------
A 25%
B 200%
C -15.00%
D 0%
E -100%
Can you suggest a script that I can set up/use in SRSS to get the percentage change, one that is similar to the sample function at the start of this discussion? Thanks!
Lirio
Mon, 04 Jul 2011 09:28:48 GMTlirioescano