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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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