Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Case Portal will move to Qlik Community Oct 4. Temporary case outage Oct 3. READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
francesco_menin
Partner
Partner

Repeated mapping load with same name

Hi all,
I was wondering if anybody could clear this up for me: I have some QVS scripts that define the same Mapping LOAD multiple times and get loaded one after another.

e.g.:

map1:
Mapping LOAD A,B From mapA.qvd;

[..some script using map1..]

map1:
Mapping LOAD A,B from mapB.qvd;

[...some script using map1...]

map1:
Mapping LOAD A,B from mapC.qvd;

[...some script using map1...]

Now we encountered some issues with the values mapped and, since there is no indication in the help, I am wondering if QlikView is always using the first declared map1 instead of redefining it every time it is declared. No error is thrown on these so we supposed always the last one was used.

Can anybody clear this up?

Thanks

Labels (6)
1 Solution

Accepted Solutions
marcus_sommer
MVP & Luminary
MVP & Luminary

Unfortunately it's not visible how Qlik handles the mapping-tables but AFAIK each mapping table-load results in a single table. This means no auto-concatenation from tables with the same data-structure or the same table-name are applied. Therefore I think it happens something similar to loads with file-wildcards in which the files have a different datastructure and this is that Qlik adds a suffix of -n (meaning -1, -2 and so on) to the tablename (for each different datastructure it adds one to the last).

In your case it would mean that you have the following mapping-tables: map1 + map1-1 + map1-2 and that all your applymap() just read the data from map1 and the others are ignored. Therefore I suggest to use the following:

map1:
Mapping LOAD A,B From mapA.qvd;

[..some script using map1..]

map2:
Mapping LOAD A,B from mapB.qvd;

[...some script using map2...]

map3:
Mapping LOAD A,B from mapC.qvd;

[...some script using map3...]

- Marcus

View solution in original post

4 Replies
anushree1
Specialist II
Specialist II

HI,

Mapping Load is always companied by ApplyMap Function.

Suggest you to check https://help.qlik.com/en-US/sense/June2019/Subsystems/Hub/Content/Sense_Hub/Scripting/MappingFunctio...

 Its describes really well what Mapping Load does

So a check that you could do is comment the Mapping Tables and check if the Script shows an error; If No Error it means there is no Applymap used in your script and thus no issue ; If there is any error it means there is a mapping table used for look up through ApplyMap function, and to answer which is the mapping table used, you must find the apply map function used in the script ; syntax of ApplyMAP is : ApplyMap('map_name', expression [ , default_mapping ] )

here 'map_name' is the name of the Mapping File used for the look up

Hope this helps

francesco_menin
Partner
Partner
Author

Hi,
I am well aware of HOW Mapping LOAD and ApplyMap() functions work together.

The point is here whether defining the same map multiple times in different points of the script would overwrite or not the map in question.

marcus_sommer
MVP & Luminary
MVP & Luminary

Unfortunately it's not visible how Qlik handles the mapping-tables but AFAIK each mapping table-load results in a single table. This means no auto-concatenation from tables with the same data-structure or the same table-name are applied. Therefore I think it happens something similar to loads with file-wildcards in which the files have a different datastructure and this is that Qlik adds a suffix of -n (meaning -1, -2 and so on) to the tablename (for each different datastructure it adds one to the last).

In your case it would mean that you have the following mapping-tables: map1 + map1-1 + map1-2 and that all your applymap() just read the data from map1 and the others are ignored. Therefore I suggest to use the following:

map1:
Mapping LOAD A,B From mapA.qvd;

[..some script using map1..]

map2:
Mapping LOAD A,B from mapB.qvd;

[...some script using map2...]

map3:
Mapping LOAD A,B from mapC.qvd;

[...some script using map3...]

- Marcus

View solution in original post

francesco_menin
Partner
Partner
Author

We decided to move to this already to be safe, there should be a way to understand if the maps get loaded with a "target" name rather than having to guess 🙂