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: 
jose_vargas
Creator
Creator

How to calculate porcentage for each dimension

Hi Community.

I have mi pivot tablet with this dimension:  "Year", "Month", "Day", "Station", "via", "group" and "Response".

MY expression are "quantity" and "Percentage". For calculate quantity is good, the problem that i have is to calculate "porcentage". I need to calculate the porcentage of quantity respeect to the dimension "via".

 For example the dimension "station" with the value "P2 - Monterrico Salida" have 2 "vias" (112 and 115).  The values for quantity is ok, the porcentage have to calculate each quantity between the total of each "via".  In this case

 P2 - Monterrico  |  112  |  PAgo  | Tag desconocido   |   Quantity = 3    | Porcentage have to be  =  3 / 1197

 P2 - Monterrico  |  112  |  PAgo  | Transito efectivo  |   Quantity = 41    | Porcentage have to be  =  41 / 1197

 P2 - Monterrico  |  115  |  Exento  | Transito exento |   Quantity = 38    | Porcentage have to be  =  38 / 2240

image.png

I use this code:

Count(Contador)/Count(TOTAL <[Respuesta]> Contador)

I tried with 

Count(Contador)/Count(TOTAL <[GrupoVariable]> Contador)

Count(Contador)/Count(TOTAL <[Cod_Via]> Contador)

Count(Contador)/Count(TOTAL <[arg_estacion]> Contador)

1 Solution

Accepted Solutions
sunny_talwar

Try this

Count(Contador)/Count(TOTAL <[arg_estacion], [Cod_Via], Ano_Est, Mes_Est, Dia_Est> Contador)

View solution in original post

4 Replies
sunny_talwar

Try this

Count(Contador)/Count(TOTAL <[arg_estacion], [Cod_Via], Ano_Est, Mes_Est, Dia_Est> Contador)
jose_vargas
Creator
Creator
Author

Thanks. Its Works!.

And how could I do now if I wanted to calculate the total of only some values of the dimension "response".
For example, in the image I just want to SUM TOTAL what is with a red box.
5 + 2 + 117 + 539 = 680
I would have something like this:

P1 Monterrico    |  105   |  Pago                            | Operacion cerrada Tag sni Vehiculo    |    5       |  0.11%   |       5/680

P1 Monterrico    |  105   |  Pago  Automatico  | Tag Manual                                                    |    117   |  2.67%   |       117/680

image.png

sunny_talwar

The non highlighed rows should show up, but the total should not include them? Also, is this only for P1? everything else doesn't need to have any kind of configuration?
jose_vargas
Creator
Creator
Author

I only have to SUM total for 4 values of the dimension "answer" for each Station and via. In this case P1 has only one way 105, but P2 has 2 ways (112 and 115) and each way must group the response values that are in yellow.

Look at the blue box, there I am calculating the percentage of quantity / SUM TOTAL of the shaded in yellow.

let me understand?

 

image.png