Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

How to Convert Numeric to Character in Visual Analytics Prepare Data

Reply
Valued Guide
Posts: 620

How to Convert Numeric to Character in Visual Analytics Prepare Data

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.

Super User
Posts: 23,932

Re: How to Convert Numeric to Character in Visual Analytics Prepare Data

Posted in reply to DavidPhillips2

There's a function called 'Treat.AS' or something along those lines and that allows you to convert the type.

Valued Guide
Posts: 620

Re: How to Convert Numeric to Character in Visual Analytics Prepare Data

Can I use this function in the graphical interrface?

Super User
Posts: 23,932

Re: How to Convert Numeric to Character in Visual Analytics Prepare Data

Posted in reply to DavidPhillips2

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:

https://communities.sas.com/t5/SAS-Communities-Library/3-FAQs-on-date-calculations-in-SAS-Visual-Ana...

New Contributor
Posts: 2

Re: How to Convert Numeric to Character in Visual Analytics Prepare Data

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

New Contributor
Posts: 2

Re: How to Convert Numeric to Character in Visual Analytics Prepare Data

Posted in reply to DavidPhillips2

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.

Ask a Question
Discussion stats
  • 5 replies
  • 1271 views
  • 2 likes
  • 3 in conversation