Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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!

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

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])

View solution in original post

13 Replies
Clever_Anjos
Employee
Employee

It looks correct.

Make a simple test:

1) add this expression

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?

lironbaram
Partner - Master III
Partner - Master III

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])

Not applicable
Author

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...

Clever_Anjos
Employee
Employee

No,

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

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

Not applicable
Author

thank you soooo much Liron Bra'am!!!

Clever_Anjos
Employee
Employee

It was just a test

Is this expression into same app, right?

Guide me to find where you are using this expression

Not applicable
Author

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...

swuehl
MVP
MVP

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] )

Not applicable
Author

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