Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
May 18th 10AM ET, Live Chat, bring your QlikView questions. REGISTER
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
Partner

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


Sum(Quantitys)/Sum(TOTAL Quantitys)

View solution in original post

12 Replies
marcarreras
Specialist
Specialist

Hi,

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

Marc.

stigchel
Partner
Partner

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


Sum(Quantitys)/Sum(TOTAL Quantitys)

View solution in original post

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
Partner

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
Partner

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