Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Merge columns from Excel source

Hi,

I want to merge columns in the load script from my Excel Source.

The table looks like this:

DateMonday notesTuesday notesWednesday notesHours
01.01.2016Meeting 11
02.01.2016Meeting 21
03.01.2016Meeting 31

I want to merge the Monday/Tuesday/Wednesday notes columns into a New column named notes:

DateMonday notesTuesday notesWednesday notesHoursNotes
01.01.2016Meeting 11Meeting 1
02.01.2016Meeting 21Meeting 2
03.01.2016Meeting 31Meeting 3

How can I do this?

Thanks!

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

You can also try,

Data:

LOAD Date,

        [Monday Notes] & [Tuesday Notes] & [Wednesday Notes] as Notes,

        Hour

FROM Table;


If the columns have any spaces, you can use trim function like below.


Trim([Monday Notes] & [Tuesday Notes] & [Wednesday Notes]) as Notes

View solution in original post

5 Replies
Kushal_Chawda

Data:

LOAD Date,

         alt( [Monday Notes],[Tuesday Notes],[Wednesday Notes]) as Notes,

         Hour

FROM Table

Kushal_Chawda

or

Data:
CrossTable(Day,Notes,2)
LOAD Date,
Hours,
[Monday notes],
[Tuesday notes],
[Wednesday notes]

FROM
[https://community.qlik.com/thread/218440]
(
html, codepage is 1252, embedded labels, table is @1);

Final:
NoConcatenate
LOAD *
Resident Data
Where len(trim(Notes))<>0;

DROP Table Data;

sunny_talwar

I like this method but with a slight modification:

Data:

LOAD Date,

         RangeMaxString([Monday Notes], [Tuesday Notes], [Wednesday Notes]) as Notes,

         Hour

FROM Table;


Capture.PNG

tamilarasu
Champion
Champion

You can also try,

Data:

LOAD Date,

        [Monday Notes] & [Tuesday Notes] & [Wednesday Notes] as Notes,

        Hour

FROM Table;


If the columns have any spaces, you can use trim function like below.


Trim([Monday Notes] & [Tuesday Notes] & [Wednesday Notes]) as Notes

Kushal_Chawda

trick acchi he..