I kinda stuck at transforming the data structure, Please help! This is what i have so far,
SELECT t0._id, t0.Category, MONTH(t0.TranDate) AS MONTHS, sum(t0.TranAmount) AS trans_total, count(t0._id) AS trans_count, t0.TranBaseType FROM [CreditSense].[dbo].[Transaction] AS t0 WHERE t0.TranDate IS NOT NULL GROUP BY t0._id, t0.Category, MONTH(t0.TranDate), t0.Time_Of_Day, t0.TranBaseType ORDER BY t0._id, t0.Category;
This is just an illustration of the real data set. If you notice I names the columns based on the instances of the various combination of categorical variables. I really what this done automatically, like creating and naming the new columns. Please HELP!