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: 
mattphillip
Creator II
Creator II

Merging two fields together

Hi, I'm hoping someone can help. I have a large dataset, and it includes two columns with similar values (academic  subjects - they cover different years with the second being a slightly revised list). I'm looking for a way to combine these two field ('Subjects 13/14' and 'Subjects 14/15') into a single 'Subject' field whilst keeping their respective values.

Is there any way to do this?

Appreciated.

Matt

33 Replies
mattphillip
Creator II
Creator II
Author

Cheers. I thought it might be something like that!

sunny_talwar

Another more efficient way (if the following statement is true: Only one of the two columns: [Subject 2012/13] and [Subject 2013/14] will have value, never both):

Script:

Table:

LOAD UniqueKey,

    Year,

    University,

    If(Len(Trim([Subject 2012/13])) > 0, [Subject 2012/13], [Subject 2013/14]) as Subject

FROM

[https://community.qlik.com/thread/186661]

(html, codepage is 1252, embedded labels, table is @1);

Output:

Capture.PNG

Anonymous
Not applicable

Hi Matt,

You can try as below for suppressing nulls:

TableA:

Load

UniqueKey,

Year,

University,

[JACS-A],

[JACS-B]

FROM

(ooxml, embedded labels, table is Sheet1);

Table:

Noconcatenate

Load UniqueKey,

Year,

University,

If(Len(Trim([JACS-A])) > 0, [JACS-A]) as JACS

Resident TableA;

concatenate

Load

UniqueKey,

Year,

University,

as JACS

If(Len(Trim([JACS-B])) > 0, [JACS-B] ) as JACS

Resident TableA;

Regards

Neetha

nizamsha
Specialist II
Specialist II

Hi

It Refer to the first 3 column and they are in ur table

UniqueKey,

    Year,

    University,