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;

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

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