I am trying to create a histogram to show how the age distributions differ between customers in two groups, e.g. high and low probability of buying a product. Ideally, I want to use a slider to dynamically change the score cutoff, so that the user can see how the two distributions look for e.g. scores above\below 0.9, 0.5, etc. I have a more static HTML based report that illustrates the two different distribution, although for a fixed cutoff. Is there a way to create two groups based on a slider or other user input?
Hello,
Did you try creating a slider that filters the histogram? If you assign your score variable to the slider, it seems like this should give you the desired result.
Or did you want your group variable to be defined by the slider setting? This could be accomplished by assigning a parameter to the slider and then creating a calculated measure based on that parameter.
Let us know if that helps, or if I am misunderstanding what you want to do. If you could show a row or two of your data, that would help us understand.
Thanks,
Sam
Hello,
Did you try creating a slider that filters the histogram? If you assign your score variable to the slider, it seems like this should give you the desired result.
Or did you want your group variable to be defined by the slider setting? This could be accomplished by assigning a parameter to the slider and then creating a calculated measure based on that parameter.
Let us know if that helps, or if I am misunderstanding what you want to do. If you could show a row or two of your data, that would help us understand.
Thanks,
Sam
What would the calculated measure look like?
I assume something like if parameter < slider value then group 1 else group 2, but I can't quite see how to write in in VA
Figured it out:
The calculated item had to be
IF ( 'Scorevariable'n >= 'cutoff parameter'p )
RETURN 1
ELSE 0
Great! Thanks for following up with us. 🙂
The calculated expression syntax in VA is a bit unusual, but it can be very useful.
Sam
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.