I am trying to change the value type from numeric to character in Visual Analytics Prepare data tool. When I try to run the results
If I just change the type to character() the column shows up as a measure.
If I set a character format, I receive ERROR: Number expression requires a numeric format.
There's a function called 'Treat.AS' or something along those lines and that allows you to convert the type.
Can I use this function in the graphical interrface?
Where you drag and drop the formula's to create them? Yes, it needs to be nested inside the main function.
This post has some pictures, if that helps:
They asked about Data Preparation tool. TreatAs does not work there, it won't pass validation. TreatAs is only available in Report Designer. You have to manually use INPUT
The trick is in the Expression section, use the INPUT function. It is not shown on the drop down of available functions, but if you type it in will work and it will pass validation. As well as not require you to unlock the code.
Parse and TreatAs are NOT available in the Data Preparation tool, those functions only work in Report Designer.
I have a numeric field that I want to display as a 7 character field and this worked for formatting directly in SAS Visual Analytics: (in text field of calculated item):
Format('Variable Name'n[Raw], 'Z7.')
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.