SAS Visual Analytics

Dashboards, reports, BI and analytics - all from a single interface.
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sas_it
Quartz | Level 8
I am having the variables with value 0 an 1. So in measure it shows count. But when i convert that to category as i want to create hierarchy does the count differs as it has 0 and 1 as values.
1 ACCEPTED SOLUTION

Accepted Solutions
acordes
Rhodochrosite | Level 12

No, you have to create a new data item.

call it character expression of your numerical variable.

use the FORMAT operator and place the numerical variable inside, choose best12. for the format.

this newly created data item works in hierarchies.

View solution in original post

6 REPLIES 6
acordes
Rhodochrosite | Level 12

I don't understand 100% your question.

BUT perhaps this may be your solution:

Depending on the context the "convert to category" option still treats the "categorical" variable as numeric preventing you from using it in a hierarchy for example.

You can overcome this by creating a categorical expression of your numerical variable by creating a calculated item "_ch_numvar" in this manner:

format(numeric_variable, best12.)

then it behaves like truly categorical

sas_it
Quartz | Level 8
Thank you for your suggestion but in hierarchy only category items are accepted. Can I merge two or more categories ?
acordes
Rhodochrosite | Level 12

the newly created item _ch_numvar is categorical.

This is achieved by using the format operator on a numerical variable. give it a try

sas_it
Quartz | Level 8
As I have to create hierarchy so I tried to convert to category from numeric and created category of that variable and chose 1 and created hierarchy. Is this correct?
acordes
Rhodochrosite | Level 12

No, you have to create a new data item.

call it character expression of your numerical variable.

use the FORMAT operator and place the numerical variable inside, choose best12. for the format.

this newly created data item works in hierarchies.

sas_it
Quartz | Level 8
For the calculated item variable i am checking if a=1 then return 1 else 0 for count. As variable contains 0 0r1 but i require 1(count of it). Is it correct?

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

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.

Discussion stats
  • 6 replies
  • 2505 views
  • 3 likes
  • 2 in conversation