Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

beck110979
Valued Contributor III

Two Fields into one Field as Filter

Hi Folks,

i have an situation which does look like, our customer deleloped the database, within this database we have a tables with 3 fields:

Project,   Project_Manager1,    Project_Manager2

A,               Mike,                     Simon

B,               Tom,                      Frank

C                Yoko                        Will

i know this database does look like a bit funny, but as you know : Your Customer is your King

i have a question: How can i combine these Fields: Project_Manager1, Project_Manager2 into one Field: ProjectManger

my expected Output is:


Project    and Filter as ProjectManager

A               Mike

               Simon

B               Tom

               Frank

C               Yoko

                Will

thanks a lot

Beck

1 Solution

Accepted Solutions
omarbensalem
Esteemed Contributor

Re: Two Fields into one Field as Filter

if u keep like this, it will create a synthetic key, but u'll have the right information; to eliminate the synthetic key, proceed as follow:

table1:

load * inline [

Project, ProjectManager

A, Takeshi

B,  James

D, Kate

](delimiter is ',');

 

table:

Crosstable (OptionField, ProjectManager) LOAD * INLINE [

Project,   Project_Manager1,    Project_Manager2

A,               Mike,                   Simon

B,               Tom,                    Frank

C ,              Yoko  ,                 Will

];

drop Field OptionField from table;

Final:

NoConcatenate

Load * Resident table;

Concatenate

load * Resident table1;

Drop Tables table,table1;

Exit Script;

result:

Capture.PNG

13 Replies
Highlighted
karthikoffi27se
Contributor III

Re: Two Fields into one Field as Filter

Hi Beck

In the script just use concate like the one below

Project_Manager1 &' '&  Project_Manager2  as ProjectManager


This should get what you want.


Many Thanks

Karthik

beck110979
Valued Contributor III

Re: Two Fields into one Field as Filter

Hi Karthik,

Thanks a lot for your feedback, but this way does not work:

my expected output is:

ProjectManager:

Mike,

Simon,

Tom,

Frank

Yoko

Will

thanks a lot

Beck

omarbensalem
Esteemed Contributor

Re: Two Fields into one Field as Filter

Mike Simon is the same Manager? as if it was First and Last name of the person?

or u want sthing like :

A Mike

A Simon

?

omarbensalem
Esteemed Contributor

Re: Two Fields into one Field as Filter

That answered my question:

table:

Crosstable (OptionField, ProjectManager) LOAD * INLINE [

Project,   Project_Manager1,    Project_Manager2

A,               Mike,                     Simon

B,               Tom,                      Frank

C ,               Yoko  ,                      Will

];

drop Field OptionField from table;

result:

Capture.PNG

beck110979
Valued Contributor III

Re: Two Fields into one Field as Filter

Hi Omar,

Mike is Project_Manager1

Simon is Project_Manager2


thanks

Beck

omarbensalem
Esteemed Contributor

Re: Two Fields into one Field as Filter

check my answer above

beck110979
Valued Contributor III

Re: Two Fields into one Field as Filter

thanks a lot

Omar, this was my first option to solution, is there any another way to solve this issue?

Thanks a lot

Beck

omarbensalem
Esteemed Contributor

Re: Two Fields into one Field as Filter

Why you're not happy with this solution?

beck110979
Valued Contributor III

Re: Two Fields into one Field as Filter

Omar, i am very happy with this solution: shukran,

i thought, what if, if my customer create a few fields within this table,

Imagine: customer creates the fileds; Project_Manager3, Project_Manager4

how can i cover another fields wth crosstable and concatenate them with another table?

thanks a lot

Beck