BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

Hello all,

 

I'm trying to create a custom category in SAS VA (version 7.4, hotfix 08), but my initial dataset (which comes in from a process and can't be changed before it hits VA) has the information I need in two different places.

 

For example:  

 

My data set contains 2 variables:

 

Variable 1:  Values:  A, B

Variable 2:  Values:  C, D, E, F

 

I'd like to create a custom category, Variable 3, which takes on these three following values:

 

X - when the value from variable 1 is A

Y - when the value from variable 1 is B AND variable 2 is C

Z - when the value from variable 1 is B AND value of variable 2 is NOT C

 

Is this possible somehow?  

 

If I had to use a hierarchy of some sort, could that do the trick?

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Sam_SAS
SAS Super FREQ

Hello,

 

This should be possible as a calculated item rather than a custom category.

 

You would use nested IF/ELSE statements. Something like this:

 

IF ( 'Origin'n In ('Asia') )
RETURN 'X'
ELSE ( 
  IF ( ( 'Origin'n = 'Europe' ) AND ( 'Type'n NotIn ('Hybrid') ) )
  RETURN 'Y'
  ELSE 'Z' )

View solution in original post

3 REPLIES 3
Sam_SAS
SAS Super FREQ

Hello,

 

This should be possible as a calculated item rather than a custom category.

 

You would use nested IF/ELSE statements. Something like this:

 

IF ( 'Origin'n In ('Asia') )
RETURN 'X'
ELSE ( 
  IF ( ( 'Origin'n = 'Europe' ) AND ( 'Type'n NotIn ('Hybrid') ) )
  RETURN 'Y'
  ELSE 'Z' )
asdfasdfasdfads
Calcite | Level 5

This was successful.  Thanks again for the help!

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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
  • 3 replies
  • 2492 views
  • 1 like
  • 2 in conversation