BookmarkSubscribeRSS Feed
tweehh
SAS Employee

Hi experts,

Is it possible to display ratio in VA report? e.g. 1:5 or 1:9.5 

Thanks!

1 REPLY 1
acordes
Rhodochrosite | Level 12

If you mean fraction, then the answer is probably yes.
In a data step the fract. format does this job. In order to see it like fraction in VA you have to burn it as a char variable using the vvalue function.

 

a1.png

 

data public.demo;
format datum ddmmyy10.;
sales=10;
datum='01jan2020'd;
do datum='02jan2020'd to today();
sales=rand("integer", 0, 20) + ceil(datum*0.0001) + ceil(rand("normal",3,2));
output;
end;
run;

data public.demo2;
merge public.demo public.demo(firstobs=2 keep=sales rename=(sales=lag_sales));
format vs_last_day fract.;
sales_total=sales+ceil(0.1*lag_sales);
vs_last_day=sales_total/lag(sales_total);
_vs_last_day=vvalue(vs_last_day);
drop sales;
run;

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

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

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