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

Load a table with Count() from another one

Hi all,

I have three tables GENDER, AGE and EMPLOYEES.

GENDER:

ID_GENDERGENDER
0homme
1femme

AGE :

ID_AGEAGE
050
160

EMPLOYEES :

ID_EMGENDERAGE
7homme50
8femme60
9femme60
10femme50

What am trying to do is to count the number of employees per gender per age in a new table using the IDs of gender and age  .

so the final result will be something like this :

ID_AGEID_GENDERtotal
001
112
011

Is it possible to do it with a qlickview script? I'm new to qlikview and I can't figure out how to do it.

Any help?

Thank you,

1 Solution

Accepted Solutions
sunny_talwar

May be like this

Gender:

LOAD * INLINE [

    ID_GENDER, GENDER

    0, homme

    1, femme

];

Age:

LOAD * INLINE [

    ID_AGE, AGE

    0, 50

    1, 60

];

Employees:

LOAD * INLINE [

    ID_EM, GENDER, AGE

    7, homme, 50

    8, femme, 60

    9, femme, 60

    10, femme, 50

];

NewTable:

NoConcatenate

LOAD ID_EM,

  GENDER,

  AGE

Resident Employees;

Left Join (NewTable)

LOAD *

Resident Gender;

Left Join (NewTable)

LOAD *

Resident Age;

FinalTable:

LOAD ID_GENDER,

  ID_AGE,

  Count(ID_EM) as Total

Resident NewTable

Group By ID_GENDER, ID_AGE;

DROP Table Gender, Age, Employees;

View solution in original post

2 Replies
sunny_talwar

May be like this

Gender:

LOAD * INLINE [

    ID_GENDER, GENDER

    0, homme

    1, femme

];

Age:

LOAD * INLINE [

    ID_AGE, AGE

    0, 50

    1, 60

];

Employees:

LOAD * INLINE [

    ID_EM, GENDER, AGE

    7, homme, 50

    8, femme, 60

    9, femme, 60

    10, femme, 50

];

NewTable:

NoConcatenate

LOAD ID_EM,

  GENDER,

  AGE

Resident Employees;

Left Join (NewTable)

LOAD *

Resident Gender;

Left Join (NewTable)

LOAD *

Resident Age;

FinalTable:

LOAD ID_GENDER,

  ID_AGE,

  Count(ID_EM) as Total

Resident NewTable

Group By ID_GENDER, ID_AGE;

DROP Table Gender, Age, Employees;

Not applicable
Author

Thank you for your answer that's exactly what i was looking for