Data Manipulation

ad2045
ad2045 New Altair Community Member
edited November 2024 in Community Q&A
I have the following data:

User ID Category Subcategory
02 A Sub1
02 B Sub2
03 C Syb7

I would like to group the data by User ID as follows:

ID
CategotyA (contains the number of subcategories)
CategoryB (contains the number of subcategories)
CategoryC( contains the number of subcategories)

example output

User IDCategoryACategoryB
022011
03555
04921

Could someone help by providing the process and parameter needed?
Tagged:

Best Answer

Answers

  • Telcontar120
    Telcontar120 New Altair Community Member
    Use the Aggregate operator, and it looks like you want to Group By User ID and Category initially (and aggregate by counting on something like user id, but it doesn't really matter).  This will give you a version of the data you want, only the way you have it, you will need to Pivot the output, where you Group By User ID (again) and Index on Category.