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

I've made a prompt (drop down format) where the user selects from a list of text values, I would like to use the TEXT VALUE that the user chooses in a computed column. As an example,  I would like to simply return the text value the user has chosen as a computed column. I tried: &promptname and it errored out. I was trying to call the value like the filter does when it calls the value of the prompt. I'm sure this feature exists.

In short: How do you call a prompt value in an advanced expression in a computed column?

1 ACCEPTED SOLUTION

Accepted Solutions
TriciaA
Calcite | Level 5

Yes macro variables require double quotes to "decode" the value.  So much fun! 

View solution in original post

3 REPLIES 3
TriciaA
Calcite | Level 5

You can use the macro variable created by the prompt ... which I don't think that will mean much to you.

Can you give me an example of how you are using this ... for instance, the user picks a word (like Dog) or a value (like 4) and then your computed column would output something like this:

"You picked: Dog"

or this   "100"  (because 25*4 is 100)

?

Anthony
Calcite | Level 5

Well the trick seemed to be use quotations. The user selects a string. I tried to report the string by doing &promptname. I tried '&promptname' and that returned "&promptname". Then I tried double quote "&promptname" and that returned the selected prompt value that I was looking for. Very odd behavior from double quotes, that's usually reserved for designating text. I appreciate your response!

TriciaA
Calcite | Level 5

Yes macro variables require double quotes to "decode" the value.  So much fun! 

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 2652 views
  • 3 likes
  • 2 in conversation