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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
matthewp
Creator III
Creator III

IF IS NULL SELECT FIELD FROM concatenated join table

Ok so i have a block of data that is built from 3 qvds, it is basically generated by..

TAB1:

LOAD * FROM qvd1

LEFT JOIN (TAB1)

TAB2:

LOAD * FROM qvd2

Resulttable:

NoConcatenate

LOAD *

RESIDENT TAB1

DROP TABLE TAB1

Finaltable:

Concatenate (Resulttable)

LOAD * FROM qvd3;

Now here is a snippet of the data:

IDREFNAMEStatusDateINoIAmtIType
856ABC 112MatthewGood21/11/20161102500P
856ABC 112MatthewGood21/11/20161157220P
856ABC 112MatthewGood21/11/20161184450P
856----1178600I
856----1127800I
856----1199750I

And here is what i want:

IDREFNAMEStatusDateINoIAmtIType
856ABC 112MatthewGood21/11/20161102500P
856ABC 112MatthewGood21/11/20161157220P
856ABC 112MatthewGood21/11/20161184450P
856ABC 112MatthewGood21/11/20161178600I
856ABC 112MatthewGood21/11/20161127800I
856ABC 112MatthewGood21/11/20161199750I

The vales in RED are from the left join of qvd 1 & 2 (resulttable) the values in BLUE are from qvd3.

They have  the ID in common so i want something like IF(ISNULL(NAME),resulttable.name,qvd3.name)

1 Solution

Accepted Solutions
matthewp
Creator III
Creator III
Author

Figured it out...

MAPPING:

MAPPING LOAD [ID],[Name]

RESIDENT resulttable;

Finaltable:

Concatenate (Resulttable)

LOAD *,

ApplyMap('MAPPING', [qvd3.ID], qvd3.NAME) AS [Name]

FROM qvd3;

View solution in original post

4 Replies
kuczynska
Creator III
Creator III

Hi Matthew,

You can always transform your qvd3 before Concatenating to Resulttable. If you know that ID is common for both qvd3 and qvd2 + qvd 1, why not to try to left join / apply map missing information from qvd 1 & qvd 2 to qvd3 and then concatenate to Resulttable?

This is course only valid if REF, NAME, Status and Date are the exact values that should be mapped to al ID's coming from qvd3.

Hope this makes some sense.

Good luck!

matthewp
Creator III
Creator III
Author

Ive used apply maps before but how would i go about doing it (just for the NAME and i can figure the rest out).

MappingName:

Mapping

LOAD Resulttable.ID,

  Resulttable.NAME

FROM

Resulttable:


Then inside the Finaltable have


Finaltable:

Concatenate (Resulttable)

LOAD *,

ApplyMap('MappingName', [ID], NAME) AS [Name]

FROM qvd3;

but cant get it to work

matthewp
Creator III
Creator III
Author

Figured it out...

MAPPING:

MAPPING LOAD [ID],[Name]

RESIDENT resulttable;

Finaltable:

Concatenate (Resulttable)

LOAD *,

ApplyMap('MAPPING', [qvd3.ID], qvd3.NAME) AS [Name]

FROM qvd3;

kuczynska
Creator III
Creator III

Hi,

What values are you getting in [Name] column within Finaltable? Is your code working ok if you would comment out Concatenate(Resulttable) in your load script?

Btw - are you qualifying all fields in Resulttable? If so your code execution may fail on Concatenate(Resultable) step as from QV perspective Resulttable.ID and ID are not the same field and (depending on the volume of data) output table may be too big to handle, etc.

Maybe post your sample app.