Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

percentage calculation (do i have to use set analysis?)

Hi everybody.

I have to make a percentage calculation above the total. For example i have a lot of Quantitys

Quantitys

100

250

300

500

100

And i have to make the % of this quantitys above the total ( 100/1250) (250/1250 etc..)

What formula should i use? I guess it may be set analysis

Thank you all

Greetings.

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

With Quantitys as your dimension in a chart, you can use


Sum(Quantitys)/Sum(TOTAL Quantitys)

View solution in original post

12 Replies
Anonymous
Not applicable
Author

Hi,

Check the 'relative' box in Expressions tab in the object properties.

Marc.

stigchel
Partner - Master
Partner - Master

With Quantitys as your dimension in a chart, you can use


Sum(Quantitys)/Sum(TOTAL Quantitys)

Not applicable
Author

Hi piet,

i have small doubt here

if we go with sum(quanitys)  it counts total all only that 100

Not applicable
Author

Sory i didnt understand this, what do yo mean?

I put this expression and it´s working. Also, i selected the % option in number presentation.

Not applicable
Author

I dont know if somebody is going to read this but..

I did this well but now im having problems with another expression similar to this.

I have to do percentage above the total of this

sum(precio) * sum(CantidadAdjudicada)

I guess it would be something like this

sum(precio) * sum(CantidadAdjudicada)  / TOTAL(sum(precio) * sum(CantidadAdjudicada) )


But it´s not working


Thank you.



Not applicable
Author

sum(precio) * sum(CantidadAdjudicada)  / TOTAL((sum(precio) * sum(CantidadAdjudicada) ))

try  like this

stigchel
Partner - Master
Partner - Master

Try

(sum(precio) * sum(CantidadAdjudicada))  / (sum(TOTAL precio) * sum(TOTAL CantidadAdjudicada) )

Not applicable
Author

Ok thank you!!

What´s the difference between that and this ?

sum(precio) * sum(CantidadAdjudicada)  / TOTAL((sum(precio) * sum(CantidadAdjudicada) ))

stigchel
Partner - Master
Partner - Master

The syntax is:


sum([{set_expression}][distinct][total[<fld {, fld}>]] expression)

Returns the aggregated sum of expression or field iterated over the chart dimension(s).

Examples:

sum(Sales)

sum(Price*Quantity)

sum(distinct Price)

sum(Sales)/sum(total Sales) returns the share within the selection

sum(Sales)/sum(total <Month> Sales) returns the share within the selection for each Month

sum(Sales)/sum(total <Month,Grp> Sales) returns the share within the selection for each Month and Grp