13 Replies Latest reply: Jun 16, 2014 3:27 AM by Irene Franceschini

# Column Percentage

I'm sure I'm writing wrong this formula

=Sum({<[Codice Documento]= {'CLI-SCONTRINO','NEG-FATIMM','FOR-DDTRESO','INT-BUONOSCA','SCA-DANN-FURTI'}>} [QTA 1 Documento])/sum (total({<[Codice Documento]= {'CLI-SCONTRINO','NEG-FATIMM','FOR-DDTRESO','INT-BUONOSCA','SCA-DANN-FURTI'}>} [QTA 1 Documento]))

I need to calculate the column percentage...how should it be written the formula? My problem is that this variable [Codice Documento] must respect those values {'CLI-SCONTRINO','NEG-FATIMM','FOR-DDTRESO','INT-BUONOSCA','SCA-DANN-FURTI'}....

thanks to everyone!

• ###### Re: Column Percentage

It looks correct.

Make a simple test:

Sum( [QTA 1 Documento])/sum (total [QTA 1 Documento])

2) Add a listbox to [Codice Documento] and select 'CLI-SCONTRINO','NEG-FATIMM','FOR-DDTRESO','INT-BUONOSCA','SCA-DANN-FURTI' using control-click

Is this value correct?

• ###### Re: Column Percentage

I know that I can do it in that way, but I'm forced to put that set of values within...I cannot filter those values otherwise other dimension values' change...

• ###### Re: Column Percentage

It was just a test

Is this expression into same app, right?

Guide me to find where you are using this expression

• ###### Re: Column Percentage

I must added that formula in the chart "Riepilogo ENTRATE" and "Riepilogo USCITE". Your solutions was correct, the point is that I needed to embody [Codice Documento]= {'CLI-SCONTRINO','NEG-FATIMM','FOR-DDTRESO','INT-BUONOSCA','SCA-DANN-FURTI'} within the formula...

• ###### Re: Column Percentage

I was late, swuehl noticed the right spot.

• ###### Re: Column Percentage

hi

you need to put the total after the set analysis part

your Expression should look like this:

=Sum({<[Codice Documento]= {'CLI-SCONTRINO','NEG-FATIMM','FOR-DDTRESO','INT-BUONOSCA','SCA-DANN-FURTI'}>} [QTA 1 Documento])/sum ({<[Codice Documento]= {'CLI-SCONTRINO','NEG-FATIMM','FOR-DDTRESO','INT-BUONOSCA','SCA-DANN-FURTI'}>} TOTAL  [QTA 1 Documento])

• ###### Re: Column Percentage

No,

=sum( {<Dim1={"A"}>} total Expression1) and

=sum(total  {<Dim1={"A"}>} Expression1) returns same value

• ###### Re: Column Percentage

thank you soooo much lironbaram!!!

• ###### Re: Column Percentage

The issue is probably due to the use of additional round brackets after total, try removing them:

=Sum({<[Codice Documento]= {'CLI-SCONTRINO','NEG-FATIMM','FOR-DDTRESO','INT-BUONOSCA','SCA-DANN-FURTI'}>} [QTA 1 Documento])/sum (total {<[Codice Documento]= {'CLI-SCONTRINO','NEG-FATIMM','FOR-DDTRESO','INT-BUONOSCA','SCA-DANN-FURTI'}>} [QTA 1 Documento] )

• ###### Re: Column Percentage

it says that there is an error in the expression...it doesn't work...

• ###### Re: Re: Column Percentage

swuehl 's formula is working for me. The location of 'total' before/after set analysis doesn't affect the result. Check attachment for your info.

• ###### Re: Re: Column Percentage

you were right! I'm wondering why it wasn't working earlier when I copied and pasted the formula into my QV file...

Well thank you for the explanation I'm glad that the order of the set analysis doesn't affect the result!

a big thanks to all of you swuehl, cuv and @Yang LU