Hello all! My colleague and I have been banging our heads over this.

I have a dataset that I am working with that was built off of a survey about overdoses on certain drugs. I'm trying to combine variables where the data is either 1 (yes) or 0 (no) to create a master variable - imagine the variable will only return the drug mentioned if it was a 1. The variables are about 20 different types of drugs and I want to group them into drug types and have the variable return the data only when it is indicated yes. For reference I've attached an example. I want to list heroin_num-alcohol_num into a new group.

I also created a listeddrugs variable using the grouplabs command and it's come in handy but not doing what I asked. I'd like to use this new variable to run specific statistics and visuals.

Hope this makes sense!

ThanksArray