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: 
Anonymous
Not applicable

Merging two fields with values

Hi All,

I have two columns in my Table Diverse. it looks like following:

Gender(US) and Gender(UK). 

Gender(US) has value 0,blank and Female.  Gender(UK) have values 0, blank, X, WBE and Female.

What I want to do is make a single field GENDER having values of Gender(UK) as it has even the values of Gender(US) ,but on selection it should give me both the records of Gender(UK) and Gender(US).

Any help would be appreciated.

Thanks.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

Try a crosstable.. see attached..

Hopefully this helps you!

View solution in original post

7 Replies
MarcoWedel

can you post an example of the results of some selections.

thanks

regards

Marco

Anonymous
Not applicable
Author

Hi marco,

That won't be possible but i think i explained the complete thing above.

Gender(US) have values:

blank

0

Female

Gender(UK) have values:

blank

0

Female

WBE

X

I want a final field with values:

blank

0

female

WBE

X

and on selection i should be able to get the records for both Gender(US) and Gender(UK).

Thanks.

adamdavi3s
Master
Master

Why not split it into two

Gender, Country

Then you can simply use set analysis or filters to work out your expressions, something along the lines of:

LOAD 'UK' as country, Gender(UK) as Gender

RESIDENT fact

WHERE Gender(UK) >0;

CONCATENATE

LOAD 'US' as country, Gender(US) as Gender

RESIDENT fact

WHERE Gender(US) >0;

And then something like

count({<Gender={'x'}>}Gender) as gender_x

count({<Gender={'x'},country={'UK'}>}Gender) as gender_x_uk



etc



Please remember to mark this answer as helpful or correct if it is.

Anonymous
Not applicable
Author

Hey Adam,

This is complicating the things. Moreover it is just not this one field, there are in total 23 fields like this which i need to merge.

Any other suggestions would be really helpful.

Thanks

Anonymous
Not applicable
Author

Hi,

Try a crosstable.. see attached..

Hopefully this helps you!

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

you can use crosstable

CrossTable(Country, gender)

LOAD * INLINE [

  id, genderUS, genderUK

  1, F, W

  2, 0, 1

];

Aurélien

Consultant Excelcio

Help users find answers! Don't forget to mark a solution that worked for you!
MarcoWedel

I guess the already suggested crosstable solution should serve you best, particularly with many source fields.

regards

Marco