0

I have trouble creating visualization in SAS Visual Analytics.

I need to visualize data on bar chart where on y axis will be product names and on x axis number of customers who have these products - in each product group (name) I need to visualize number of customers who have this product in the particular month and the same month year ago - for comparison (f.e. march 2023 and march 2022). For better understanding I am attaching sketch of graph enter image description here - blue column month 2023, black column month 2022 of the particular product.

My dataset looks like this (1 represents that customer has the product and 0 that he has not):

| month | customer_id | product1 | product2 | product3| ... | productn |
| ----- | ----------- |     1    |     0    |     1   |     |     1    |  
| ----- | ----------- |     0    |     1    |     0   |     |     1    |  
| ----- | ----------- |     1    |     1    |     1   |     |     0    |  
| ----- | ----------- |     0    |     1    |     1   |     |     0    | 

The problem is when I am importing data into SAS Visual Analytics from SAS BI, it is visualized in the form of groups by date, not product. So instead of several products on y axis there are 2 month (2022,2023) and products within it. And I struggle transforming the data into convenient format when I would be able to visualize it as it is presented on the attached image.

Thank you in advance!

I tried to sum() products in SAS BI and group it by month, by that did not solve anything bc I need to group it by product, but I do not know how. In SAS Visual Analytics I could not find any options that could group it by product instead of date.

Stu Sztukowski
  • 10,597
  • 1
  • 12
  • 21

1 Answers1

1

A better data structure for this would be

month customer_id product_num
Jan 1 1
Jan 1 3
Jan 1 n

This would allow you to group by product number (or product name or whatever makes the most sense).

Joe
  • 62,789
  • 6
  • 49
  • 67