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

[ASK] join 2 column into 1

hello qlikview master..

i wanna ask a question, simple but complicated

so i have an excel files with data format like below :

idschool_namemale_genderfemale_gender
1school A46
2school B35
3school C57
4school D1319

and i suppose to make the data format like below in qlikview :

id
school_namegendertotal
1school Amale4
1school Afemale6
2school Bmale3
2school Bfemale5
3school Cmale5
3school Cfemale7
4school Dmale13
4school Dfemale19

and i have thousands of datas that makes me impossible to do it manually one-by-one

how to do that in qlikview?

many thx...

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Data:

LOAD

     id,

     school-name,

     'male' AS gender,

     total

FROM DataSource

Where gender = 'male';

CONCATENATE(Data)

Data:

LOAD

     id,

     school-name,

     'female' AS gender,

     total

FROM DataSource

Where gender = 'female';

Now you have columns id, school-name, gender and total as you required.

Hope this helps you.

Regards,

Jagan.

View solution in original post

5 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Data:

LOAD

     id,

     school-name,

     'male' AS gender,

     total

FROM DataSource

Where gender = 'male';

CONCATENATE(Data)

Data:

LOAD

     id,

     school-name,

     'female' AS gender,

     total

FROM DataSource

Where gender = 'female';

Now you have columns id, school-name, gender and total as you required.

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

you mention 'total' column, where is it come from?

because there is no 'total' column in data-source

many thx

==========

edited

i think i know what do you mean

let me give it a shoot

jagan
Luminary Alumni
Luminary Alumni

Hi,

Use this script

Data:

LOAD

     id,

     school-name,

     'male' AS gender,

     'male_gender' AS total

FROM DataSource

Where gender = 'male';

CONCATENATE(Data)

Data:

LOAD

     id,

     school-name,

     'female' AS gender,

    'female_gender' AS total

FROM DataSource

Where gender = 'female';

Regards,

Jagan.

Not applicable
Author

Data:

LOAD

     id,

     school-name,

     'male' AS gender,

     male_gender as total

FROM DataSource;

CONCATENATE(Data)

Data:

LOAD

     id,

     school-name,

     'female' AS gender,

     female_gender as total

FROM DataSource';

many thx jagan

jagan
Luminary Alumni
Luminary Alumni

Hi,

You are correct, where condition should be removed.  I posted it in a bit hurry. 

Regards,

Jagan.