Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

count values using a group

Reply
Contributor
Posts: 20

count values using a group

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.

Kris

Trusted Advisor
Posts: 1,410

Re: count values using a group

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,

Michelle

 

Frequent Contributor
Posts: 80

Re: count values using a group

Posted in reply to MichelleHomes
Hi Michelle,

Thanks for the great tip about Derived Items.

Downunder Dave.
Contributor
Posts: 62

Re: count values using a group

Posted in reply to MichelleHomes

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.

Trusted Advisor
Posts: 1,410

Re: count values using a group

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 http://documentation.sas.com/?cdcId=vacdc&cdcVersion=8.3&docsetId=vawn&docsetTarget=n1ehcc5pjl4yrtn1... 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,

Michelle

Contributor
Posts: 62

Re: count values using a group

Posted in reply to MichelleHomes

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?

Ask a Question
Discussion stats
  • 5 replies
  • 569 views
  • 2 likes
  • 4 in conversation