Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
beck_bakytbek
Master
Master

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

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

View solution in original post

13 Replies
karthikoffi27se
Creator III
Creator III

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

beck_bakytbek
Master
Master
Author

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

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

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

beck_bakytbek
Master
Master
Author

Hi Omar,

Mike is Project_Manager1

Simon is Project_Manager2


thanks

Beck

OmarBenSalem

check my answer above

beck_bakytbek
Master
Master
Author

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

Why you're not happy with this solution?

beck_bakytbek
Master
Master
Author

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