Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Am trying to work out a formula which calculates the increase/decrease in sales (premium) for a selected year compared to the previous year.
Formula below works fine except in one circumstance where the sales (premium) for the previous year (year-1) is empty.
if((sum({$<Year = {$(=Only(Year))}>} Premium) -
(sum({$<Year = {$(=Only(Year)-1)}>} Premium)))/
(sum({$<Year = {$(=Only(Year)-1)}>} Premium))>=0,1,0)))
Any suggestions please?
thanks!
steve
alt(
if((sum({$<Year = {$(=Only(Year))}>} Premium) -
(sum({$<Year = {$(=Only(Year)-1)}>} Premium)))/
(sum({$<Year = {$(=Only(Year)-1)}>} Premium))>=0,1,0))),
0 // or another default value
)
formula doesn't accept anything after the >=0,1))
Sorry, too much ")"
=alt(
if((sum({$<Year = {$(=Only(Year))}>} Premium) -
(sum({$<Year = {$(=Only(Year)-1)}>} Premium)))/
(sum({$<Year = {$(=Only(Year)-1)}>} Premium))>=0,1,0),
0 // or another default value
)
i guess in order to have a better performance...
use in chart propieties, presentation tab unselect null symbol and missing symbols at the left end of the windown
and use a simple expresion
(
sum({$<Year = {$(=Only(Year))}>} Premium) -
sum({$<Year = {$(=Only(Year)-1)}>} Premium)
) /
sum({$<Year = {$(=Only(Year)-1)}>} Premium)