Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
Not applicable

great confusion? i want map product id in 2 tables how to map?if i use join giving syntax error

map1:

Mapping

LOAD productid,

     description

FROM

M:\ONLYQLIKVIEW\DOCUMENTS\MAPPING\map.xlsx

(ooxml, embedded labels, table is product);

join

LOAD productid,

     discount

    // promoDiscount

FROM

M:\ONLYQLIKVIEW\DOCUMENTS\MAPPING\map.xlsx

(ooxml, embedded labels, table is discount);

map3:

Mapping

LOAD customerid,

     [customer name]

FROM

M:\ONLYQLIKVIEW\DOCUMENTS\MAPPING\map.xlsx

(ooxml, embedded labels, table is customer);

5 Replies
Highlighted
Not applicable

Re: great confusion? i want map product id in 2 tables how to map?if i use join giving syntax error

Hi Manoj, you can't join the a table to Mapping Table.

Please ask the question clearly to get the help.

You can use one map tables any times in the script.

Highlighted
sudeepkm
Valued Contributor III

Re: great confusion? i want map product id in 2 tables how to map?if i use join giving syntax error

The Mapping load is for reference look up. Here you have two tables having productid common so if you do normal load then QlikView will associate both product table and discount table. If I misunderstood your requirement then may I request you to explain it again.

Highlighted
Not applicable

Re: great confusion? i want map product id in 2 tables how to map?if i use join giving syntax error

my requrirement is i want map product id in two tables if i write applymap('map1','map2',productid) as pid  its mapping only one table that is map2. but my requirement is to map productid in 2 tables? hw to write query

Highlighted
Not applicable

Re: great confusion? i want map product id in 2 tables how to map?if i use join giving syntax error

my requrirement is i want map product id in two tables if i write applymap('map1','map2',productid) as pid  its mapping only one table that is map2. but my requirement is to map productid in 2 tables? hw to write query

Highlighted
sudeepkm
Valued Contributor III

Re: great confusion? i want map product id in 2 tables how to map?if i use join giving syntax error

To me it looks like you might not have used the Mapping load at the right place. You may have to reconsider loading of the tables. Given below is how you can use a mapping load. Assume that you have a table named as job table having

jobcode and jobdesc.

And you want the job desc as a field in another table based on the values of job code then you can load the job table as a mapping load.

Job:

mapping load

jobcode, jobdesc from job;

MainTable:

empid, emploc, jobid, applymap('Job',jobid) as jobdesc from emp;

In your case if you want to bring the product description and product discount from two tables then you can create two map tables and use two applymap script to load the description and discount as two different fields in your main table.