HI,
I have recently been introduced to SAS VA and using version 7.3
I have a client requirement to add a text box where i would input something like "sales for this quarter" & Variable Sales ..
would look something like "sales for this quarter $100000"
I have tried to find a way but not able to. Can anyone help me on this please ?
Update: dynamic texts, introduced in VA 7.4 and also available in VA 8.x, would be a better solution for this scenario now.
Text objects support several types of dynamic text:
Here’s the relevant link to the 8.3 doc for reference.
If using VA 7.3 the traditional base SAS concatenation is not possible in a standard text box. There is a workaround that has been described in using a button bar that you may find a good work around at https://communities.sas.com/t5/SAS-Communities-Library/SAS-Visual-Analytics-trick-Use-a-button-bar-a...
(And here's a "how to" if you're looking for how to concatenate values in traditional SAS programming.)
Kind Regards,
Michelle
This is called concatenation. There are many ways to do this:
|| - to bars means concatenate, this is the basic methid.
cat() - is a function to concate strings, pretty much the same as ||, but you can put in many strings
catx() - is a function to concactenate strings with a delimter between
cats() - is a function to concactenate strings removing whitespace.
Plus many others. look at the documentation as its a basic functionality. So your problem can be:
result=cat"sales for this quarter",put(variable_sales,dollar10.2));
@RW9 - FYI, the cat family functions are not available within SAS VA 7.3 or early.
Update: dynamic texts, introduced in VA 7.4 and also available in VA 8.x, would be a better solution for this scenario now.
Text objects support several types of dynamic text:
Here’s the relevant link to the 8.3 doc for reference.
If using VA 7.3 the traditional base SAS concatenation is not possible in a standard text box. There is a workaround that has been described in using a button bar that you may find a good work around at https://communities.sas.com/t5/SAS-Communities-Library/SAS-Visual-Analytics-trick-Use-a-button-bar-a...
(And here's a "how to" if you're looking for how to concatenate values in traditional SAS programming.)
Kind Regards,
Michelle
Thanks MichelleHomes !!!!
Not the best way to do it but atleast would give me something to work with.
My pleasure @Phoenix232 and I understand the workaround is not ideal... Development are aware of this popular requirement and I believe are working on it for a future release. See https://communities.sas.com/t5/SAS-Visual-Analytics/Dynamic-Text-Input-based-on-Drop-Down/m-p/273118...
Thanks for marking the response solved.
Kind Regards,
Michelle
Hi Phoenix
The basic rule is "allways format as the type of variable, that you need to deal with".
IE: If you need to add or subtract days from a date; convert the date to a number (using the operator "TreatAs"), then do the maths, and wrap the entire formula in a new "TreatAs" to convert back to date-format.
Same thing with numeric values: Use "Format" and "Best" as operator to convert from numeric to string. Concatenate the two and you are done!
I've added a matrix showing which operators to use in VA 7.3, if you wish to convert between variable types.
Best regards
Jais
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!
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.