Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
seeusoon
Contributor
Contributor

Combine Table?

Dear all,

I have below two tables. Table1 and Table2. After I loaded the data, Qlikview auto joined the tables using the key.

Table1

KeyColumn1
SN1A
SN2B
SN3C
SN4D

 

Table2

KeyColumn2
SN1A1
SN2B1
SN3 
SN4D1

 

Qlikview joined the table using the key.

 KeyColumn1Column2
SN1AA1
SN2BB1
SN3C 
SN4DD1

 

Question here - If I want the null field in Column2 replaced with the value "C" in Column1. How can I replace the value and achieve below result?

 Column1Column2
SN1AA1
SN2BB1
SN3CC
SN4DD1

 

Thank you.

1 Solution

Accepted Solutions
MindaugasBacius
Partner
Partner

tmp:
Directory;
LOAD Key, 
     Column1
FROM
Book1.xlsx
(ooxml, embedded labels, table is Sheet1);


Left Join (tmp)
LOAD Key, 
     Column2
FROM
Book1.xlsx
(ooxml, embedded labels, table is Sheet2);


NoConcatenate
tmp2:
LOAD Key
	,Column1
	,If(Len(Trim(Column2)) = 0, Column1, Column2) as Column2
Resident tmp;

DROP Table tmp;

And the results:

Screenshot_1.jpg

Pay attention that you will be left with only one table.

View solution in original post

1 Reply
MindaugasBacius
Partner
Partner

tmp:
Directory;
LOAD Key, 
     Column1
FROM
Book1.xlsx
(ooxml, embedded labels, table is Sheet1);


Left Join (tmp)
LOAD Key, 
     Column2
FROM
Book1.xlsx
(ooxml, embedded labels, table is Sheet2);


NoConcatenate
tmp2:
LOAD Key
	,Column1
	,If(Len(Trim(Column2)) = 0, Column1, Column2) as Column2
Resident tmp;

DROP Table tmp;

And the results:

Screenshot_1.jpg

Pay attention that you will be left with only one table.

View solution in original post