Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, I have as input a table like this:
ID | cosite | Tech | Band | UL | DL |
1 | and | 3G | N | 10 | 20 |
1 | and | 2G | L | 10 | 20 |
1 | and | 3G | M | 10 | 20 |
1 | and | 4G | L | 10 | 20 |
1 | and | 4G | L | 10 | 20 |
1 | no | 3G | N | 10 | 20 |
1 | and | 3G | N | 10 | 20 |
1 | and | 3G | N | 10 | 20 |
1 | and | 4G | M | 10 | 20 |
1 | and | 3G | N | 67 | 20 |
1 | and | 2G | M | 67 | 20 |
1 | and | 2G | L | 67 | 23 |
1 | and | 3G | L | 67 | 23 |
1 | no | 4G | N | 67 | 23 |
1 | and | 4G | N | 67 | 23 |
2 | and | 4G | N | 67 | 23 |
2 | and | 3G | N | 67 | 23 |
2 | and | 2G | M | 34 | 23 |
2 | and | 3G | N | 34 | 23 |
2 | and | 2G | N | 34 | 23 |
2 | and | 2G | N | 34 | 23 |
2 | and | 3G | L | 34 | 23 |
2 | and | 3G | M | 34 | 23 |
2 | and | 2G | N | 34 | 3 |
2 | and | 3G | M | 34 | 3 |
2 | and | 3G | N | 34 | 3 |
2 | and | 2G | L | 34 | 3 |
2 | no | 3G | N | 34 | 3 |
2 | and | 3G | M | 34 | 3 |
3 | and | 3G | N | 34 | 46 |
3 | and | 4G | M | 34 | 46 |
3 | and | 3G | N | 34 | 46 |
3 | and | 4G | N | 34 | 46 |
3 | and | 4G | N | 6 | 46 |
3 | and | 3G | L | 6 | 46 |
3 | and | 3G | N | 6 | 46 |
3 | and | 3G | N | 6 | 46 |
3 | no | 4G | L | 6 | 46 |
3 | and | 3G | M | 6 | 46 |
3 | and | 4G | N | 6 | 46 |
3 | and | 3G | N | 6 | 46 |
I want to know how many ID (different, so as much the result will be 3) are within a range set by me. The ranking method is obtained to calculate the percentage of traffic (sum (UL) + sum (DL)) which is offered in Tech = 4G in relation to the traffic carried on Tech Tech = = 2G and 3G,
Moreover, one need only consider cosite = yes (if cosite = no not taken into account) and must differentiate by Banda.
So, for example, each percentage shall be calculated as:
(sum(UL)+sum(DL))[Tech=4G,cosite=si,Banda=M]/(sum(UL)+sum(DL))[Tech=2G and Tech=3G,cosite=si,Banda=M]
(sum(UL)+sum(DL))[Tech=4G,cosite=si,Banda=N]/(sum(UL)+sum(DL))[Tech=2G and Tech=3G,cosite=si,Banda=N]
(sum(UL)+sum(DL))[Tech=4G,cosite=si,Banda=L]/(sum(UL)+sum(DL))[Tech=2G and Tech=3G,cosite=si,Banda=L]
and for each distinct ID.
Depending on the range where the outcome of that percentage calculated are, we will add 1 to counter,
and similar to that shown table get here (not actual results):
Band | |||
% Range | M | N | L |
<40% | 2 | 0 | 1 |
40-60% | 1 | 0 | 0 |
>60% | 0 | 3 | 0 |
TOTAL | 3 | 3 | 1 |
I hope you have understood well, because the truth is a little hard to tell and rather more to understand ...
Greetings to all!
Translated with Google Translate - Qlik Community Administrative Team
Hola a todos, yo tengo como entrada una tabla parecida a esta:
ID | cosite | Tech | Banda | UL | DL |
1 | si | 3G | N | 10 | 20 |
1 | si | 2G | L | 10 | 20 |
1 | si | 3G | M | 10 | 20 |
1 | si | 4G | L | 10 | 20 |
1 | si | 4G | L | 10 | 20 |
1 | no | 3G | N | 10 | 20 |
1 | si | 3G | N | 10 | 20 |
1 | si | 3G | N | 10 | 20 |
1 | si | 4G | M | 10 | 20 |
1 | si | 3G | N | 67 | 20 |
1 | si | 2G | M | 67 | 20 |
1 | si | 2G | L | 67 | 23 |
1 | si | 3G | L | 67 | 23 |
1 | no | 4G | N | 67 | 23 |
1 | si | 4G | N | 67 | 23 |
2 | si | 4G | N | 67 | 23 |
2 | si | 3G | N | 67 | 23 |
2 | si | 2G | M | 34 | 23 |
2 | si | 3G | N | 34 | 23 |
2 | si | 2G | N | 34 | 23 |
2 | si | 2G | N | 34 | 23 |
2 | si | 3G | L | 34 | 23 |
2 | si | 3G | M | 34 | 23 |
2 | si | 2G | N | 34 | 3 |
2 | si | 3G | M | 34 | 3 |
2 | si | 3G | N | 34 | 3 |
2 | si | 2G | L | 34 | 3 |
2 | no | 3G | N | 34 | 3 |
2 | si | 3G | M | 34 | 3 |
3 | si | 3G | N | 34 | 46 |
3 | si | 4G | M | 34 | 46 |
3 | si | 3G | N | 34 | 46 |
3 | si | 4G | N | 34 | 46 |
3 | si | 4G | N | 6 | 46 |
3 | si | 3G | L | 6 | 46 |
3 | si | 3G | N | 6 | 46 |
3 | si | 3G | N | 6 | 46 |
3 | no | 4G | L | 6 | 46 |
3 | si | 3G | M | 6 | 46 |
3 | si | 4G | N | 6 | 46 |
3 | si | 3G | N | 6 | 46 |
Quiero saber cuantos ID (distintos, por lo que como mucho el resultado será 3) se encuentran dentro de unos rangos impuestos por mi. La clasificacion por rangos se obtiene de calcular el porcentaje de tráfico (sum(UL)+sum(DL)) que se cursa en Tech=4G en relacion con el tráfico cursado en Tech=2G y Tech=3G,
Además, solo hay que tener en cuenta cosite=sí (si cosite=no no se tiene en cuenta) y hay que diferenciar por Banda.
Entonces, por ejemplo, se calculará cada porcentaje como:
(sum(UL)+sum(DL))[Tech=4G,cosite=si,Banda=M]/(sum(UL)+sum(DL))[Tech=2G and Tech=3G,cosite=si,Banda=M]
(sum(UL)+sum(DL))[Tech=4G,cosite=si,Banda=N]/(sum(UL)+sum(DL))[Tech=2G and Tech=3G,cosite=si,Banda=N]
(sum(UL)+sum(DL))[Tech=4G,cosite=si,Banda=L]/(sum(UL)+sum(DL))[Tech=2G and Tech=3G,cosite=si,Banda=L]
y para cada ID distinta.
En función del rango donde se encuentre el resultado de ese porcentaje calculado, sumaremos 1 al contador,
y se obtendría una tabla parecida a la mostrada aquí (no son resultados reales):
Banda | |||
%Rango | M | N | L |
< 40% | 2 | 0 | 1 |
40-60% | 1 | 0 | 0 |
>60% | 0 | 3 | 0 |
TOTAL | 3 | 3 | 1 |
Espero que se haya entendido bien, porque la verdad, es un poco dificil de contar y bastante mas de entender...
Un saludo a todos!
Hola, te adjunto el script en un fichero de texto (solo carga los datos y genera el campo 'Rango')
Luego he creado una tabla pivotante, con Rango y Banda como dimensiones.
La expresión de esta tabla es:
If(Dimensionality(),
Pick(Rango,
Count(DISTINCT Aggr(NODISTINCT If(Sum({<cosite={'si'}, Tech={'4G'}>} UL+DL)/Sum({<cosite={'si'}, Tech={'2G','3G'}>} UL+DL)<0.4, ID), ID, Banda)),
Count(DISTINCT Aggr(NODISTINCT If(Sum({<cosite={'si'}, Tech={'4G'}>} UL+DL)/Sum({<cosite={'si'}, Tech={'2G','3G'}>} UL+DL)>=0.4
and Sum({<cosite={'si'}, Tech={'4G'}>} UL+DL)/Sum({<cosite={'si'}, Tech={'2G','3G'}>} UL+DL)<=0.6, ID), ID, Banda)),
Count(DISTINCT Aggr(NODISTINCT If(Sum({<cosite={'si'}, Tech={'4G'}>} UL+DL)/Sum({<cosite={'si'}, Tech={'2G','3G'}>} UL+DL)>0.6, ID), ID, Banda))
),
Count(DISTINCT ID)
)
Hola, a ver si te sirve el documento que te adjunto.
Saludos.
Gracias, pero tengo la Personal Edition, por lo que no puedo abrir el fichero. ¿Habría otra manera de poder verlo?
Hola, te adjunto el script en un fichero de texto (solo carga los datos y genera el campo 'Rango')
Luego he creado una tabla pivotante, con Rango y Banda como dimensiones.
La expresión de esta tabla es:
If(Dimensionality(),
Pick(Rango,
Count(DISTINCT Aggr(NODISTINCT If(Sum({<cosite={'si'}, Tech={'4G'}>} UL+DL)/Sum({<cosite={'si'}, Tech={'2G','3G'}>} UL+DL)<0.4, ID), ID, Banda)),
Count(DISTINCT Aggr(NODISTINCT If(Sum({<cosite={'si'}, Tech={'4G'}>} UL+DL)/Sum({<cosite={'si'}, Tech={'2G','3G'}>} UL+DL)>=0.4
and Sum({<cosite={'si'}, Tech={'4G'}>} UL+DL)/Sum({<cosite={'si'}, Tech={'2G','3G'}>} UL+DL)<=0.6, ID), ID, Banda)),
Count(DISTINCT Aggr(NODISTINCT If(Sum({<cosite={'si'}, Tech={'4G'}>} UL+DL)/Sum({<cosite={'si'}, Tech={'2G','3G'}>} UL+DL)>0.6, ID), ID, Banda))
),
Count(DISTINCT ID)
)
Thank you very much!!! It definitely works really good!!