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: 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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