BookmarkSubscribeRSS Feed
Beatrize
Calcite | Level 5

I am new to SAS and I currently working in SAS Visual Analytics(latest version). 
I have a cross in SAS VA that is similar to the one below:

YearReturn On Investment (%)
20195%
202010%
202117%
20224%

 

But I want to add a third that calculates the year on year change in SAS VA, like the one below.
May I have assistance?

YearReturn On Investment (%)YoY change
20195%5%
202010%7%
202117%-13%
20224% 
1 REPLY 1
tsukune
SAS Employee
RelativePeriod returns the aggregated value for a period of time that is relative to the current period.
 
The calculated item is created by the following syntax:
(RelativePeriod(_Sum_, ROI_PCT, ApplyAllFilters, YEAR, Inferred, 0, Full) - RelativePeriod(_Sum_, ROI_PCT, IgnoreInteractiveTimeFrameFilters, YEAR, ByYear, 1, Full))* -1
 
Here is a sample output: 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 360 views
  • 0 likes
  • 2 in conversation