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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with Mapping Table and Apply Map

Hi,

I am relatively new to Qlikview but have come across a stumbling block.  I am trying to merge 2 separate SQL tables into one and create a relationship between a field called fixcode in TABLE1 (OPENCALL) and a field called code in TABLE2 (FIXCODE).

I have been advised to use an APPLYMAP function in my LOAD script, but I have never done one before.

I have attached a copy of the details in my load script at the moment in text pad format.

In my OPENCALL table the code is in a single string separated by hyphens.  It is stored in a field called fixcode. Therefore my code looks likes this:

FLT0-CRPR-RRCL-SSWO

RQST-CORP-RCC1-NWSP

etc....

In my FIXCODE table all of the codes are stored in a field called code and each 4 digit code is entered into a row.  Theres is also another field called descx which sets a value to the code.  In ths Table it looks like this:

Codedescx
FLT0Fault
RQSTRequest
RCC1Oracle
SSWOPassword Reset

I will be amending my script to amend the OPENCALL table so that I can put each code into seprate columns.  However what I then want to do is match the code from my OPENCALL table and match it with the FIXCODE Table so the the following will show:

FLT0-CRPR-RRCL-SSWO

Fault-Corporate Software-Oracle-Password Reset

I have no idea how to even start the Mapping table.  I was wondering if someone could help me figure out how to do this.

Regards,

Jon Ditchfield

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

The table fixcode from which you are trying to load doesn't have a field fixcode, but code. However, I think you're referencing the wrong table for the Opencall load and should load from your opencall table instead which does have a field named fixcode.


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

maybe something like this:

Mapping loadFixcodes:

load

Code,

Descx

from Table2;

Opencall:

load *,

subfield(fixcode,'-',1) as level1,

subfield(fixcode,'-',2) as level2,

subfield(fixcode,'-',3) as level3,

subfield(fixcode,'-',4) as level4,

applymap('Fixcodes',subfield(fixcode,'-',1)) as level1desc,

applymap('Fixcodes',subfield(fixcode,'-',2)) as level2desc,

applymap('Fixcodes',subfield(fixcode,'-',3)) as level3desc,

applymap('Fixcodes',subfield(fixcode,'-',4)) as level4desc,

applymap('Fixcodes',subfield(fixcode,'-',1)) & '-' &

applymap('Fixcodes',subfield(fixcode,'-',2)) & '-' &

applymap('Fixcodes',subfield(fixcode,'-',3)) & '-' &

applymap('Fixcodes',subfield(fixcode,'-',4)) as fulldescx

from Table1;


talk is cheap, supply exceeds demand
Not applicable
Author

Hi,

I am getting the following Script Error:

Cannot open file c:\Documents and Setting\ditcjz\Desktop\opencall

Not applicable
Author

Hi,

I have a connection to the DB, I had to amend my load script.  However now when I amend my Load script, a message occurs saying no such field fixcode.

Attached is a copy of my load script.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

The table fixcode from which you are trying to load doesn't have a field fixcode, but code. However, I think you're referencing the wrong table for the Opencall load and should load from your opencall table instead which does have a field named fixcode.


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you very much for your help.  It was more than what I was expecting to be honest and its made my report look alot better.  Thank you again.