G
Guest
I take the top 5 records in my table (based on $$) and calculate percentages
of total $$. I then sum those percentages, and in a 3rd query I subtract that
sum from the total $$ to get the percent for everyone else. I have to do it
this way, as I'm given the total $$ - summing total records will not give the
same result as what I'm given. Therefore I can't calculate the percentage for
all records and then sum for my not-top 5.
My sum query comes back with 5 results with the same sum over and over
again. My net query comes back with 125 (5X5X5).
I'm assuming that it's because I pull those top 5 records into my query so
it'll know which items to sum, but is there a way around it?
of total $$. I then sum those percentages, and in a 3rd query I subtract that
sum from the total $$ to get the percent for everyone else. I have to do it
this way, as I'm given the total $$ - summing total records will not give the
same result as what I'm given. Therefore I can't calculate the percentage for
all records and then sum for my not-top 5.
My sum query comes back with 5 results with the same sum over and over
again. My net query comes back with 125 (5X5X5).
I'm assuming that it's because I pull those top 5 records into my query so
it'll know which items to sum, but is there a way around it?