05-19-2015 06:35 AM
Hi, I am new to SAS VA, using v7.1
I am trying to create a report with a hyperlink against each row of data, so that when the hyperlink is clicked it will take the user to a particular web page.
I presume the best way to do this is to right mouse on my column, for example 'Product Name', then select Add Link, External Link. However, I need to add some logic to say something like,
if the 'Product Name' = 'A', then the external hyperlink is https://productA,
if the 'Product Name' = 'B', then the external hyperlink is https://productB,
Do I need to add a 'Link to Stored Process'? If so, how and where do I create a Stored Process?
Or is there a better way to do this?
05-22-2015 10:51 AM
You are on the right track. When you create an external link, you can include a data driven portion, but the initial part of the URL must by static. The entire URL can not be data driven in the current and prior releases. If you have a portion of the URL that is consistent, you can type that in and pass the dynamic portion by choosing a data item from the parameter drop-down list in the Create External Link window. Note that this data item can be a calculated data item that you create in the report. The target for the parameter portion of the parameter is optional, and I suspect you would leave that blank in your case.
You'll need to create a calculated data item from the data tab in the left panel that includes your IF THEN ELSE logic. I'm assuming you have more than two products, so you would need to nest IF THEN ELSE statements if you use this approach. If you have many products, you might want to consider storing the dynamic portion of the URL for the product in the source table. If the product name is the only portion of the URL that's dynamic and the URL is based on the product name, you can use string functions, like LowerCase() and URLEncode() that might let you create the dynamic URL portion in an expression without any IF THEN ELSEs.
Here's a few links to the relevant portions of the VA User's Guide for 7.2, just in case. This works the same in 7.1 and earlier releases.
Ashley, I hope this helps. Post back if you get stuck or have other questions.
03-24-2016 06:14 PM
@RickStyll_SAS: I have looked for a solution how to click on an individual row in a list table with an url as text value which is an external link to a pdf document. Your tip looks promising but I have no idea how to apply it. It's too advanced for me. Could you be so kind and write more details about creating such calculated item consisted of static and dynamic parts of url? A few screen shots would be very helpful for me. I have searched VA guide but there were no simple tutorial how to do this...
I use 7.1 version of VA.
Thank you in advance :-)
03-25-2016 06:02 PM
You mentioned you searched the VA User's Guide and couldn't find a simple tutorial. Just in case you didn't see this part, you might find the section of the documentation at this link helpful.
To create a link to an external PDF from a list table, you'll need to go to the interactions tab in the right panel. From there, click the New option and select External Link from the drop-down.
Next, you will see a pop-up window where you can enter the static portion of the URL.
From there, click the plus symbol, labeled Add a new parameter. Then you'll see...
Choose a data item for the source drop-down selector that represents the portion of the URL that is different for each row of your list table. If your source data contains the full URL, you might need to create a calculated data item in the left panel to truncate the portion of the URL that is the same for every row. The portion that's the same is what you'll type into the URL field near the top of this pop-up window.
@WKruk, I hope this helps.
12-01-2017 04:05 AM
thanks for your answer. Well, I understand the part that you "don't want to create stored processes", however, I believe that is the best practice (and probably the only way in SAS VA 7.X).
SAS VA 8.X (in Viya platform) can show URLs without stored processes, as far as I know.