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 : ))
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.
Alternatively you can create a calculation manually using a formula like:
Hope that helps!
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 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.