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
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.