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

convert numeric measure year to category variable year

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

convert numeric measure year to category variable year

hi everyone,

i have a data set which has Year as measure and i need to convert it to category variable year.

 

Can any one help me in this.

how can i do it?

 if i do it how is it going to affect my rest operations on data? what are the steps to be considered before i do this.

 

Any suggestion and help is much appreciated.

 

Thanks


Accepted Solutions
Solution
‎10-21-2017 04:43 AM
Trusted Advisor
Posts: 1,406

Re: convert numeric measure year to category variable year

Posted in reply to sas_viclearner

Hi @sas_viclearner,

 

I see you are new user to the SAS community - welcome!

 

To change the year from a measure to a category type you simply need to do this from the data properties pane on the left side (assuming you are using SAS Visual Analytics 7.x?) Have a look at the documentation?

 

Year is a data type that wouldn't normally be used for statistical analysis and having it as a category type does make sense. Whether this impacts anything, really depends on how the data item is being used in other objects in your report.

 

If you are changing the data type only in an exploration or report then it will be only for that exploration or report. If you are changing the type in the data builder then you are changing the type for the result table and it may have a flow on effect depending on where Year is used.

 

Without knowing your environment and how your data item is used it is difficult to advise what the affect will be.

 

Kind Regards,

Michelle

View solution in original post


All Replies
Contributor
Posts: 29

Re: convert numeric measure year to category variable year

Posted in reply to sas_viclearner

you can use put function to convert numeric data to character e.g.

put(column_name, 8.);

 

you will no longer be able use the string year for numeric operations ..

Solution
‎10-21-2017 04:43 AM
Trusted Advisor
Posts: 1,406

Re: convert numeric measure year to category variable year

Posted in reply to sas_viclearner

Hi @sas_viclearner,

 

I see you are new user to the SAS community - welcome!

 

To change the year from a measure to a category type you simply need to do this from the data properties pane on the left side (assuming you are using SAS Visual Analytics 7.x?) Have a look at the documentation?

 

Year is a data type that wouldn't normally be used for statistical analysis and having it as a category type does make sense. Whether this impacts anything, really depends on how the data item is being used in other objects in your report.

 

If you are changing the data type only in an exploration or report then it will be only for that exploration or report. If you are changing the type in the data builder then you are changing the type for the result table and it may have a flow on effect depending on where Year is used.

 

Without knowing your environment and how your data item is used it is difficult to advise what the affect will be.

 

Kind Regards,

Michelle

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 344 views
  • 1 like
  • 3 in conversation