BookmarkSubscribeRSS Feed
Saurabh77
Fluorite | Level 6

Hello Everyone,

 

Please understand the query bit correctly.

 

I have one value 'X' and for that i have thousands of observations (Values basically lie withing 0 to 200)

Now what i want to build is a programing to set diffrent limits to this 'X'.

 

Example - I want to see how many observations are above 100 (Value of X)

 

In same program I should be able to see this results if i apply filter to see all the observations above 75 or lets say all the observations above 50 and so on...

 

Now I wrote following program (I know somehow i need to get rid of this ELSE ...but quetions is how?).

 

 

 

IF ( 'X' > 100 )
RETURN 'For 100'
ELSE ( 
  IF ( 'X' > 75 )
  RETURN 'For 75'
  ELSE ( 
   
 IF ( 'X' > 50 )
    RETURN 'For 50'
    ELSE 'other' ) )W

hat results it is showing is...For the limit of 100 it is showing right results ..but when i tried to see results for 50 or 75..it is showing me all the observations above 50 or 75 but below 100.

 

What i  want to see is all the observation above 75 and 50.

 

Could you please help for this on bit urgent basis.

I will really appriciate.

 

Best Regards,

Saurabh 

1 REPLY 1
FredrikE
Rhodochrosite | Level 12

If you are using VA7.4 or above you can use parameters.

 

1. create a new numeric parameter

2. assign the parameter to an input object (like slider, input text)

3. create a filter either directly on the data (data set filter) or on your object. The filter should look something like "x > [parameter name]"

 

This should work so if you set the parameter to 75 the data shown will be greater than 75.

 

//Fredrik

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 473 views
  • 1 like
  • 2 in conversation