Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

mapping in qlikview

Hi,

I have loaded Postcodes and State into table "PostCodeMapping"

PostCodeMapping table:-

Postcode    State

200              ACT

221              ACT

801              NT

851              NT

1023            NSW

1030            NSW

I now need to add the State the to resident UserTable.  I have the postcode in the resident table to use in the lookup.  how do i return postcode into the resident table?

Cheers.

1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

Hi,

If you want to map you state field to another table, first create mapping table with the Prefix of 'Mapping'

and use ApplyMap in your Resident table.

so, your code should be like this..

StateMappingTable:
MAPPING LOAD Postcode,
State
FROM
PostCodeStateMapping.xlsx
(
ooxml, embedded labels, table is Sheet1);


if this not your issue, can you provide the sample data?

View solution in original post

10 Replies
settu_periasamy
Master III
Master III

Try

PostCodeMappinTable:

Mappling Load Postcode, State from Source;


New:
Load Fields,Postcode

ApplyMap('PostCodeMappingTable',Postcode,'Unknow') as State

From Source;

saniyask
Creator
Creator

Hi Laura,

see the below example ..

PostCodeMapping:-

Mapping LOAD Postcode

     State

FROM

-----(qvd);

Usertable:

LOAD Postcode,

     xyz,

     ApplyMap ('PostCodeMapping ',Postcode,'NA') as State

FROM

---- (qvd);

Anonymous
Not applicable
Author

Hi Settu,

thanks Settu but don't understand.

I have already have the postcode and state in a table called "PostCodeMappinTable:".  so do i do the "NEW" bit in the Resident script or in a separate script?  This is what i have done so far:-

StateMappingTable:
LOAD Postcode,
State
FROM
PostCodeStateMapping.xlsx
(
ooxml, embedded labels, table is Sheet1);






concatenata(UserSummary)
Load Fields, Postcode
ApplyMap('StateMappingTable',Postcode,'Other')as State;

Not applicable
Author

First create the mapping table.

PostCodeMapping:
Mapping Load    

     Postcode,

     State

from (path).

Now call this mapping table into the resident usertable.
Use syntax:

ApplyMap('PostCodeMapping',postcode) as State

Alternatively you can use:

lookup(fieldname, matchfieldname, matchfieldvalue [, tablename])

Returns the value of fieldname corresponding to the first occurrence of the value matchfieldvalue in the fieldmatchfieldname.

settu_periasamy
Master III
Master III

Hi,

If you want to map you state field to another table, first create mapping table with the Prefix of 'Mapping'

and use ApplyMap in your Resident table.

so, your code should be like this..

StateMappingTable:
MAPPING LOAD Postcode,
State
FROM
PostCodeStateMapping.xlsx
(
ooxml, embedded labels, table is Sheet1);


if this not your issue, can you provide the sample data?

Anonymous
Not applicable
Author

got it.  thanks Settu.

if i want to show each state on a separate line in the line chart how do i do this please?

I.e. I have member numbers on the y axis and the months are on the bottom along the x axis.  i want to show the member numbers by state (each state being on its own line)?

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Firstly load the mapping table (before loading any data concerning UserSummary table):

StateMappingTable:

Mapping Load

     Postcode,

     State

From PostCodeStateMapping.xlsx

(ooxml, embedded labels, table is Sheet1);

Next step is to map the information in UserSummary table with StateMappingTable.

You should just add additional line in the UserSummary table:

ApplyMap('StateMappingTable', Postcode, 'Unknown') as State,

The UserSummary table must have the field name Postcode.

settu_periasamy
Master III
Master III

Have you tried put your state also in your dimension (x-axis)?

Dimension: Month and State

Expression : Count(Members)

do you have a sample data?

Anonymous
Not applicable
Author

does "value on data points" still work with multiple lines?  I've tried but the numbers do not show as they do on a single line graph?