I would like to change the structure of a dataset so as to be able to extract information easily. Here is my example: I have 5 portfolios, each of them containing different number of shares of different products. The information is stored in the following table:
What I would like to do is to change the shape of the table into the following:
If I had few data, I would just apply a filter and exclude for each portfolio the "0" from the selection (and I would do this for each of them separately). Hence, I'm looking for a way to do this in an automatic way, without doing it manually. I'm not sure if there is a way to do it in Excel. I was thinking about the following SQL (pseudo-)code:
SELECT Portfolio_Name, Product_Name, Number_Shares
FROM Table_Name
GROUP BY Portfolio_Name