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: 

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore 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
  • 612 views
  • 0 likes
  • 2 in conversation