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

 

Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.

 

Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer. 

 

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