9 Replies Latest reply: Sep 17, 2012 5:04 PM by Stefan Wühl

# Sum select list from list box

Ok so what I'm trying to do is sum all values in a list box (100%) of values but only display the ones I have selected in the list box. The sum function I'm using works (sum(Discharges) / sum( total <DischargeYear,DischargeQuarter> Discharges) ) to show me the correct values in the graph, but when I only select 2 or 3 fields from the list box it changes the values in the graph and they become the 100%. How do i keep a sum of 100% but only select a few fields.

example:

yellow = 5

blue = 20

green =50

black=10

red =15

all will total 100% and I could put this in a graph, but the minute I select Yellow and green (to display in the graph)  I still want to see yellow is 5% and green is 50%, and not the new selected (yellow and green) having the values 90% and 10%.

• ###### Re: Sum select list from list box

Hi

Do you mean, no change in the graph value?

if so, use Sum({1}Discharges) / sum({1} total <DischargeYear,DischargeQuarter> Discharges)

Edit:

Then use

Sum(Discharges) / sum({1} total <DischargeYear,DischargeQuarter> Discharges)

Hope it helps

• ###### Re: Sum select list from list box

yes, no change to the graph value, but it would only display yellow and green.

• ###### Re: Sum select list from list box

I think this is the correct answer, but now I'm getting a odd fraction in %'s. I know I'm talking about discharges... but my example I would have like .82% for yellow and .3% fro green. Graph still looks correct, just not sure how to get the values back 90% and 10 % values.

• ###### Re: Sum select list from list box

HI

For 90% and 10%, use

=sum(Discharges) / sum(total <DischargeYear,DischargeQuarter> Discharges)

For 5% and 50%

=sum(Discharges) / sum({1} total <DischargeYear,DischargeQuarter> Discharges)

• ###### Re: Sum select list from list box

Could you post a small sample file? Probably there is some more complexity in your data than in the sample above.

• ###### Re: Sum select list from list box

Try disregarding your selection in the total calculation, maybe like

=sum(Discharges) / sum({1} total <DischargeYear,DischargeQuarter> Discharges)

• ###### Re: Sum select list from list box

I don't want to disregard the select because I now only want to display Yellow and green, not all in the list box.

• ###### Re: Sum select list from list box

I think I've understood, as I said, only disregard selection for the total value calculation.

Works for me.

Just give it a try.

• ###### Re: Sum select list from list box

Hi

=sum(Discharges) / sum({1} total <DischargeYear,DischargeQuarter> Discharges)

This wil help you.. Can you provide a sample file?