BookmarkSubscribeRSS Feed
Obsidian | Level 7

Hi there,


I am using SAS VA 7.3.

How can I get the value in a variable in SAS VA Report Designer that is equivalent to the count produced by below query ?


Select customer_type, count( distinct customer_id) 

from table 

group by customer_type;


Thanks in advance.


Meteorite | Level 14

You can create a derived item on your customer_id category using the Creating Derived Items technique described in the SAS Visual Analytics User Guide: Creating Derived Items


To get a table of each customer_type by the distinct customer_id use both data items in a table object and you'll have the listing you desire. If you prefer a different visual then use customer_type and your derived item in that.


Kind Regards,



//Contact me to learn how Metacoda software can help keep your SAS platform secure -
Lapis Lazuli | Level 10
Hi Michelle,

Thanks for the great tip about Derived Items.

Downunder Dave.
Pyrite | Level 9

Hi @MichelleHomes

is there a way to create an aggregated variable, such as the one you suggested in this post, and then use it's distinct value in order to create other report?

For example i want to create a report that counts distinct customers that made that amount of count.

Meteorite | Level 14

It seems that what you are trying to achieve @gabras is now available in the newly released SAS Visual Analytics 8.3 on SAS Viya 3.4. See documentation and the Enhanced Data Pane section. 


If you are using any other release you’ll need to create the aggregated value as a query or outside VA and have the data source available for the new report.


Kind Regards,


//Contact me to learn how Metacoda software can help keep your SAS platform secure -
Pyrite | Level 9

It seems to me that SAS VA doesn't support a dinamic report except for SAS Viya.


But if i use a data query in the Data Preparation Panel is it possible to treat the query builder as a stored process?

Let's say i create the query. is it possible to associate a from_data and to_data prompts to trigger the execution of the quey in order to create the report?



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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
  • 5 replies
  • 4 in conversation