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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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