BookmarkSubscribeRSS Feed
Rajesh_02
Calcite | Level 5

Can we implement arrow symbol in list table or crosstab for the numeric value(Increment/Decrement)

Rajesh_02_0-1628142288056.png

 

11 REPLIES 11
Madelyn_SAS
SAS Super FREQ

Some versions of SAS Visual Analytics support adding graphs to crosstabs, but there is no version that does exactly what you are asking. Which version are you using? 

acordes
Rhodochrosite | Level 12

Is it possible with the help of job execution and data-driven-content to display sgplot generated graphs inside the VA report?

Calling @Renato_sas as well...

Renato_sas
SAS Employee

@acordes, yes you can do that. Here is an example of SAS Job that leverages sgplot:

https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/jobexecug/n0t91q5lsc2b8qn14fd0cgbmylr8.htm... 

 

And if you combine it with some of the articles I wrote about SAS Jobs integrated with data-driven content, you should be able to make it work:

Tag: "VA-DDC-Jobs Integration" in "SAS Communities Library" - SAS Support Communities

 

Best,

Renato

acordes
Rhodochrosite | Level 12

It's weird. I'd like to use the img src tag option like it's recommended in the link you shared but I don't have a clue what to put for the host:port part.

When I create a job in job execution and connect to the caslibs I use a command line

options cashost="xxxxxx.xxxx.es" casport=xxxx and it works, but these don't work here.

My final goal is to call the job from the VA report using a web content object and let the job open the form and execute the sas code for the graph.

With the form I allow for some user input and in my understanding in the same window of the form I should be able to leverage the graph I draw with SG Plot.

So I want to have a form plus graph within the report.

But as I said I'm struggling to get it working.

 

 

 

Sam_SAS
SAS Employee
In newer versions of VA, we have a Job Content object that automatically displays the output of a job. This might be ideal for you if you can upgrade to a recent Viya 4 release.
acordes
Rhodochrosite | Level 12

We're upgrading to 3.5 in the next weeks. In my understanding at least I can use the common task model language which will come in handy for populating dynamic list boxes based on the data. 

I have managed to achieve more or less what I wanted to do.

The form displays in VA and once the run button is pressed the form disappears and the graph draws having applied correctly the parameter supported filter. I have achieved this by suppressing the _target="tab" option in the html code.

 

What is still missing is to have a button that brings back the form again because the graph persists. When I draw whatever object on the report pane then the web content refreshes and the form is shown again. How can I include a going back button in the job code part?

<!DOCTYPE html>
<html lang="en">

<head>
<title>Return SGPLOT Image Output</title>
<link rel="stylesheet" href="/SASJobExecution/theme">
</head>

<body role="main" class="jobexec_body">

<form class="jobexec_form" action="/SASJobExecution/" >
<input type="hidden" name="_program" value="/Public/renato/labor/test2"/>
<input type="hidden" name="_action"  value="execute"/>
<div class="jobexec_sample_header">SAS<sup>®</sup> Job Execution</div>

<h1 class="jobexec_sample_name">Return SGPLOT Image Output</h1>

<p>
The SGPLOT procedure creates a bar chart using the SASHELP.CLASS
table, and returns the binary image data to the client.
</p>

<label for="age_min">Output format:</label>
<select name="age_min" id="age_min" class="jobexec_sample_select">
  <option value="12">twelve</option>
  <option value="13">thirteen</option>
  <option value="14">fourteen</option>
</select>


<br/>
<br/>

<label for="_odsstyle">ODS style:</label>
<select name="_odsstyle" id="_odsstyle" class="jobexec_sample_select">
  [More values here]
  <option value="HTMLBlue" selected>HTMLBlue</option>
  [More values here]
</select>

<br/>
<br/>

<hr/>

<input type="submit" value="Run code" class="jobexec_sample_input_submit"/>
<input type="checkbox" name="_debug" id="_debug" value="log" 
   class="jobexec_sample_input_checkbox"/>
<label for="_debug">Show SAS Log</label>

</form>

</body>

</html>


*  Declare input parameters;

%global _ODSSTYLE
        age_min;


ods graphics / imagemap;

proc sgplot data=sashelp.class; 
where age gt &age_min;
hbar age / tip=(AGE) ; 
run; 
quit;

sgplot within va.png

 

Renato_sas
SAS Employee

You cannot have a back button in the prompt framework. To reload the prompt interface, you can hit Alt+Left Arrow twice - it is like the browser back button.

If you really want a back button, you need to use an HTML form for you parameters.

Renato_sas
SAS Employee

@acordes, I'm assuming you are talking about this url: http://host:port/SASJobExecution

 

This is the URL to your Viya applications, normally same host and port that you use for Visual Analytics.

Sam_SAS
SAS Employee

Hello Rajesh,

 

This functionality is not currently available but it is something we are interested in as a possible future addition.

 

Currently, the best way to indicate change would be to make a display rule as follows:

 

1. Create a "Difference from previous period" calculation by right-clicking a measure on the Data pane and selecting "New Calculation" :change3.gif

 

2.  Create your table. Add the measure and the date column. Add the "Difference from previous period" calculation to the Hidden role if you don't want to show it, or add it to the Columns role if you do.

 

3. Create a display rule on the Rules pane that is based on the "Difference from previous period" calculation and colors the measure values according to whether the value is less than 0

change.gif

Set the Placement option to be the original measure rather than the calculated measure.

 

Your result should look like this:

change2.gif

Where the value is less than the previous value, it is colored by the display rule. You can repeat these steps for additional measures as needed.

 

A limitation of this approach is that you MUST include the date column in your table.

 

I hope this helps,

Sam

Renato_sas
SAS Employee

You can work around it for List tables (no crosstabs, unfortunately):

 

Renato_sas_0-1630445139472.png

 

The Good/Bad column is a character calculated item defined as below:

Renato_sas_1-1630445225743.png

The arrows (and other symbols) can be obtained from an unicode table. For this example, I've used:

🠕 - Upwards Arrow with Equilateral Arrowhead: U+1F815 - Unicode Character Table (unicode-table.com)

🠗 - Downwards Arrow with Equilateral Arrowhead: U+1F817 - Unicode Character Table (unicode-table.co...

 

What's nice about the links above is that you can simply find what you want, use the copy button, and paste the symbol in the VA expression.

 

Then all you need to do is define a display rule similar to the formula used in the expression to assign the color, as seen in the first screenshot.

 

Renato_sas_0-1630445984097.png

 

Sam_SAS
SAS Employee
Great workaround!

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!

Tips for filtering data sources in SAS Visual Analytics

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.

Discussion stats
  • 11 replies
  • 2072 views
  • 11 likes
  • 5 in conversation