Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have three tables GENDER, AGE and EMPLOYEES.
GENDER:
ID_GENDER | GENDER |
---|---|
0 | homme |
1 | femme |
AGE :
ID_AGE | AGE |
---|---|
0 | 50 |
1 | 60 |
EMPLOYEES :
ID_EM | GENDER | AGE |
---|---|---|
7 | homme | 50 |
8 | femme | 60 |
9 | femme | 60 |
10 | femme | 50 |
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_AGE | ID_GENDER | total |
---|---|---|
0 | 0 | 1 |
1 | 1 | 2 |
0 | 1 | 1 |
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,
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;
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;
Thank you for your answer that's exactly what i was looking for