Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How I can make 2 group by? (¿Cómo puedo hacer 2 group by?)

Hello everyone,

I'm new in QlikView, I read the tutorial this there are the web but is too basic in my opinion, and I find sources which explain more things about queries and selections, as well as terms and nomenclature used QlikView . So I ask this question to see if anyone can help.

I have two .csv files (tabal1.csv and tabla2.csv) and that's where will upload the tables, let 'Table1' and 'Table 2'. These tables have many columns each, but I will give an example of what I do. Suppose we are interested in each table the following columns connected by the 'ID' column:

Table 1:

ID Tech Site

1 4G if

2 3G if

3 3G not

4 2G not

5 2G if

Table 2:

ID Vo1 Vo2

1 10 0

2 0 67

March 3 34

4 4 0

5 0 0

Note: You can not have a row with 4G and Site Tech = = 'no', provided that Tech is 4G, Site will be 'yes'.

What I get is: Sum (Vo1 + Vo2) and grouped by Site Tech (which is not the best order), but only Tech group 2G and 3G, 4G no. Therefore, the result table should look like:

Agrupacion Total (Sum (Vo1 + Vo2))

4G (if) 10

3G-2G (if) 67

3G-2G (no) 41

No I have come to explain properly, anything you can ask me. The main problem is I do not know the nomenclature (syntax) using QlikView, so do not even know how to start loading only those columns that interest me, and not load the entire tables ...

Thank you very much in advance and I hope your answers !!

Greetings to all !!!!

Translated with Google Translate - Qlik Community Administrative Team

Hola a todos, soy nuevo en QlikView, me leí el tutorial este que hay por la web pero es demasiado básico en mi opinión, y no encuentro fuentes donde expliquen más cosas acerca de consultas y selecciones, así como expresiones y la nomenclatura que utiliza QlikView. Por eso hago esta pregunta a ver si alguien puede ayudarme.

Yo tengo dos archivos .csv (tabal1.csv y tabla2.csv) y de ahí es de donde cargaré las tablas, supongamos 'Tabla1' y 'Tabla 2'. Estas tablas tienen muchas columnas cada una, pero voy a poner un ejemplo de lo que quiero hacer. Supongamos que de cada tabla nos interesan las siguientes columnas, conectadas por la columna 'ID':

Tabla1:

ID     Tech     Site

1      4G        si   

2      3G        si

3      3G        no

4      2G        no

5      2G        si

Tabla2:

ID     Vo1      Vo2

1      10         0

2      0           67

3      3           34

4      4           0

5      0           0

Nota: no puede haber una fila con Tech=4G y Site='no', siempre que Tech sea 4G, Site será 'sí'.

Lo que quiero obtener es: Sum(Vo1+Vo2) agrupado por Site y Tech (no se cual es el mejor orden), pero en Tech agrupar solo el 2G y el 3G, el 4G no. Por tanto, la tabla resultado debería quedar así:

Agrupacion     Total (Sum(Vo1+Vo2))

4G (si)            10

3G-2G (si)       67

3G-2G (no)      41

No se si he llegado a explicarme correctamente, cualquier cosa me podéis preguntar. El principal problema es que no conozco la nomenclatura (sintaxis) que utiliza QlikView, por eso no sé ni cómo empezar a cargar solo esas columnas que me interesan, y no cargar las tablas enteras...

Muchas gracias de antemano y espero vuestras respuestas!!

Un saludo a todos!!!!

12 Replies
perumal_41
Partner - Specialist II
Partner - Specialist II

Hi Jose ,

change expression like below

sum({<Fecha={'>=20150401 <=20150430'}>}Vo1)+sum({<Fecha={'>=20150401 <=20150430'}>}Vo2)

Regards,

Perumal A

Not applicable
Author

Hi Perumal A! Thank you very much! That's what I was looking for!

If I am interested in comparing 2 months, April and May, in the same bar graph, do I have to write 2 expressions like this?

=sum({<Fecha={'>=20150401 <=20150430'}>}Vo1)+sum({<Fecha={'>=20150401 <=20150430'}>}Vo2)

=sum({<Fecha={'>=20150501 <=20150531'}>}Vo1)+sum({<Fecha={'>=20150501 <=20150531'}>}Vo2)

Regards,

Jose

perumal_41
Partner - Specialist II
Partner - Specialist II

Hi Jose,

if you are plan to take month as dimension  then use below expression

=sum({<Fecha={'>=20150401 <=20150531'}>}Vo1)+sum({<Fecha={'>=20150401 <=20150531'}>}Vo2)

esle use

two seperate expression  like aboue you mention

Regards,

Perumal A