Hi All,
I have a query on how to create aggregate measure of sum(_bygroup) of a variable.
Let's say I have example dataset as below:
ID | Sales |
2345 | 126.98 |
7624 | 425.99 |
2345 | 500.00 |
9834 | 613.54 |
9834 | 193.67 |
2345 | 523.99 |
And I want to create aggregate measure of total sales by ID such as below:
ID | Total Sales | Aggregated Measure |
2345 | 1150.97 | 1,000 and above |
7624 | 425.99 | Below 500 |
9834 | 807.21 | Between 500 and 1,000 |
How can I do that in SAS Visual Analytics?
I was not able to get it to work with using the _bygroup_ aggregation. With Viya, if you don't mind creating an aggregated table then you can accomplish this with the following steps.
1. Create the aggregated table. (Select Data menu --> icon next to current table ---> New Data from aggregation of ....
I only select id and sales for the table to make it most efficient.
2. Create the customer category named 'Aggregated Measure'
3. Create a list table and include the three data items.
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.
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.