BookmarkSubscribeRSS Feed
yiyhio
Fluorite | Level 6

Hey guys!

 

I have a dataset of 1.2 million rows, each representing an e-mail with email_id as primary key. A customer might have received several e-mails, and the row for each e-mail contains the customer_id it was sent to. I want to make a bar chart representing how many customers received 1, 2, 3, 4 etc. e-mails from us. Ideally, it should be done dynamically within SAS VA, so that the reader can use a slider to decide the period he/she wants to look into.

 

In python, I would count the number of received e-mails per customer_id, append these numbers as a column to the dataset and run .value_counts() on the appended column. How can this be done in the drag-and-drop environment of SAS VA?

 

Thanks in advance : ))

2 REPLIES 2
HarrySnart
SAS Employee

Hi. If I've understood your question correctly, this should be available automatically using the 'Frequency' attribute. Just set the level of aggregation needed. 

 

Take for example the cars dataset, frequency updates depending on what you add to the list table.

HarrySnart_0-1660041268854.png

HarrySnart_1-1660041309573.png

 

 

Alternatively you can create a calculation manually using a formula like:

HarrySnart_2-1660041321366.png

 

Hope that helps!

yiyhio
Fluorite | Level 6

We are getting closer! To continue on your cars example, I'd like to do a bar chart representing how many 'make' were bought 7 times, 8 times, 9 times etc. In your screenshot, all makes have different buying frequencies but say if Ferrari, Skoda and Tesla were bought 7 times like Acura, the bar representing "bought 7 times" should have a height of 4. Any suggestions? : ))

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
  • 2 replies
  • 620 views
  • 2 likes
  • 2 in conversation