BookmarkSubscribeRSS Feed
DandarahZ
Obsidian | Level 7

I have a category that has 2 values. I know that i am able to duplicate the category, however would like to know whether i am able to permanantly remove a value from the category.

13 REPLIES 13
SASKiwi
PROC Star

What does "remove a value from a category" mean? Change a value in a column from non-missing to missing? Remove all rows that match a particular value? Or something else? Posting an example of what you want would be helpful.

DandarahZ
Obsidian | Level 7

Hello. I would like to apologize for being unclear with my message,

 

I have an occupancy column with 2 values, 0, 1. I would like to know if there is a way to separate the values into a column each eg: Unoccupied = 0

Occupied =1

 

I have tried using substrings, filters and creating new categories to manipulate the 2 values but to no avail. At the same time, a side question, is changing the datatype of category to measure possible?

 

Regards

Dan 

SASKiwi
PROC Star

Can you explain the type of report you are trying to produce? A screenshot of made-up data would be fine. The reason is to confirm if the way you want to change the data is the best for your report.

DandarahZ
Obsidian | Level 7

Hello, i thank you for the reply,

 

I am required to create some dashboards for the client. The dashboards will give an over view about room usage :

 

Picture1.JPG

 

I inted to separate the occupance data into 2 different variables, occupied and non occupied. At the same time, i would like to find a way on how to convert the category datatype to measure to enable the be variables to be placed in the measure (y) axis of the graph above.

 

Picture2.JPG

 

I apologize for any troubles caused

 

Regards

Dan 

FredrikE
Rhodochrosite | Level 12

Hi!

You can create two new calculated measures:

 

occupied:

=============

IF occupancy = '1' then  return 1

ELSE 0

 

nonoccupied:

=============

IF occupancy = '0' then  return 1

ELSE 0

 

Keep default aggregation (SUM).

 

 

//Fredrik

 

DandarahZ
Obsidian | Level 7

Hello and thank you for the reply,

 

I am unable to create calculated measures, the only option was for me to create a new aggregated measure. When brought to the formula screen, i dragged the boolean IF/ELSE statement to the workspace and dragged the category in. After it got dragged in, i got thrown an errror saying wrong type assigned.

 

These 2 screenshots are the options that are displayed, as i mentioned, there is no option to create aggregated measures

Capture1.JPGCapture2.JPG

 

If I cant create calculated measures, what should be my next step? Do i have to ensure that the data thatt gets loaded into VA must be of the proper values? Does VA allow flexible type conversion?

 

Regards

FredrikE
Rhodochrosite | Level 12

Hi!

Sorry if I mislead you, I only have the swedish version....:)

 

You should select "New Calculated Item..." and create two new "items", one for occupied and one for nonOccupied as a showed earlier.

 

Go into "text edit" (or what it's called in the english versoin....:)) and copy/paste the formulas I gave you, they might need some fine-tuning to fit your exact data 🙂

 

//Fredrik

 

DandarahZ
Obsidian | Level 7
Hello Mr Fredrik, thank you for your reply. I have a follow-up question. Can the same method be used if the data type is now a measure as compared to it previously being a category type?
FredrikE
Rhodochrosite | Level 12

Hi!

Sorry, but I don't understand your question, can you add some example of what yo want to do?

🙂

//Fredrik

DandarahZ
Obsidian | Level 7

I apologize for the vagueness of the question.

 

As with the previous question, i want to separate the values (0,1) into 2 different categories. However, now instead of occupancy being a category type, it is now a measure type.

 

Will separating the values 0 and 1 be possible for occupancy with the data type of measure

 

Once again i apologize for any troubles caused.

 

Regards

Dan

FredrikE
Rhodochrosite | Level 12

No probz 🙂

 

You can't create rows in VA, so if you have one row containing the measures you can't create two dimension values on separate rows, which i guess is what you want to do 🙂

 

You can create two (or more) dimension values on the same row, but I don't know if it is usable in your case...

//Fredrik

DandarahZ
Obsidian | Level 7

Hello Sir, i fail to understand what you meant in your past reply,

 

I hope the information i have provided can help you understand my situation better,

 

 

I intend to make a butterfly graph

Picture3.JPG

 

As shown in the graph above, i require 1 category and 2 measure data types. I already have the category data prepared. I am however, having problems with the measure data. Within the occupancy measure data, there are 2 values as shown below. (Im am using category data for show/reference)

Picture4.JPG

 

My question is that since occupancy is classified as a measure data type how do i separate the values 0,1 and the data into 2 different varibables. (below is a screen short of the intended outcome)

 

Picture5.JPG

As mentioned not occupies will only have the zeros

and occupied will only have ones

 

I apologize for the repeated question Mr Fredrick. I appreciate any and all the help that you have given me

 

Regards

Dan

 

 

 

FredrikE
Rhodochrosite | Level 12

Hi!

I think you can use my earlier suggestion, if I understand you correct 🙂

You can descide if you want to have 0/1 in both variables by changing the expression.

//Fredrik

 

 

"You can create two new calculated measures:

 

occupied:

=============

IF occupancy = '1' then  return 1

ELSE 0

 

nonoccupied:

=============

IF occupancy = '0' then  return 1

ELSE 0

 

Keep default aggregation (SUM)."

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 13 replies
  • 1123 views
  • 0 likes
  • 3 in conversation