- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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 ?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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:
- Measure values
- Parameter values
- A timestamp for the most recent update of the current data source
- A description of the current interactive filters (from prompts and from actions with other objects)
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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));
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@RW9 - FYI, the cat family functions are not available within SAS VA 7.3 or early.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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:
- Measure values
- Parameter values
- A timestamp for the most recent update of the current data source
- A description of the current interactive filters (from prompts and from actions with other objects)
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks MichelleHomes !!!!
Not the best way to do it but atleast would give me something to work with.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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