Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I was trying to calculate the percentage increase of previous value.
for example:
aggr(Sum({<Year = {'$(=Max(Year))'}>}Sales),Year,Country) // Latest year
aggr(Sum({<Year = {'$(=Max(Year)-1)'}>}Sales),Year,Country) // previous year
Differences of them :
Difference = aggr(Sum({<Year = {'$(=Max(Year))'}>}Sales),Year,Country)-aggr(Sum({<Year = {'$(=Max(Year)-1)'}>}Sales),Year,Country)
What i want is to calculate is the% increase/decrease of previous year
Change of % = Difference / Previous year * 100
How this can be done in set expression syntax.
What is the context of your expression? Where do you use it / What are dimensions used etc.?
In general, this should calculate your percentage change:
= num(
Sum({<Year = {'$(=Max(Year))'}>}Sales) / Sum({<Year = {'$(=Max(Year)-1)'}>}Sales) -1
,'#.00%')
What is the context of your expression? Where do you use it / What are dimensions used etc.?
In general, this should calculate your percentage change:
= num(
Sum({<Year = {'$(=Max(Year))'}>}Sales) / Sum({<Year = {'$(=Max(Year)-1)'}>}Sales) -1
,'#.00%')
The concept is to calculate the % of change in sales per country in years.
Dimension is Country
Thanks.
This expression calculates only the firs value.
= num(
Sum({<Year = {'$(=Max(Year))'}>}Sales) / Sum({<Year = {'$(=Max(Year)-1)'}>}Sales) -1
,'#.00%')