Forum Discussion
Unpivoting and re-Pivoting creating duplicates
Ahmedx thank you for the reply, however it looks like this is summing all columns that have a value in my table (my dataset is much bigger than in the sample provided). Any idea why it's summing all columns?
show this step
- obriaincian2 years ago
Resolver I
- Ahmedx2 years ago
Super User
everything is correct, but what should not be summed by which column?
- Ahmedx2 years ago
Super User
show next steps
- obriaincian2 years ago
Resolver I
unfortunately i can't show all the columns but these snippets are from the final step
This column shows the sum
Below are the columns that need to be summed, If we take the first row above which returns 13 for the sum, we can see below that the sum should be zero, I think what's happening is that it's summing all columns with a value as I have a column called "FY NU" which has 12 and the index column for this row is 1 which gives us 13
- Ahmedx2 years ago
Super User
show it