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

Special characters in mapping load name

I'm trying to name my Mapping load table as follows:

[map SK02-21]:
MAPPING LOAD * INLINE [
Kode,Kundsegment
SK1, Superkunde Private
SK2, Superkunde Public
];

I want to use the minus (-) sign because my customer will recognise this name-structure from her other systems.

I use

applymap('[map SK02-21]', Kode1)

but the applymap returns nothing.

It seems to me that QV have trouble recognizing my mapping table name as a string, but it has no problem recognizing it if I choose to save it as a regular table. Am I missing the correct syntax? Or should I consider this as a bug? I've tried is in both QV9 and QV10.

An ugly workaround (my purpose for using the namestandard is lost) is to put [map SK02-1] into an variable [varSK] and use

[$([varSK])]:
MAPPING LOAD * INLINE [
Kode,Kundsegment
SK1, Superkunde Private
SK2, Superkunde Public
];

And call the applymap using the variable like this.

applymap('[$([varSK])]', Kode1)

1 Solution

Accepted Solutions
Not applicable
Author

Alex,

By looking at your code I see my mistake. I have used the ' ' and [ ] wrong.

I called the map with

applymap('[map SK02-21]', Kode1)

but the correct syntax should be

applymap('map SK02-21', Kode1)

Thank you for your feedback.

View solution in original post

5 Replies
Not applicable
Author

Hi Vegar,

mapping tables will be dropped automatically at the end of script execution. So names here doesn't really matter. For naming persistent tables look at my snippet:


[SK02-21]:
LOAD * INLINE [
Kode,Kundsegment
SK1, Superkunde Private
SK2, Superkunde Public
];

'whatever SK02-21':
Load
Kundsegment as MySeg
Resident [SK02-21];

'next SK02-21':
Load
MySeg as OurSeg
Resident [whatever SK02-21];


Regards, Roland

Not applicable
Author

Hi,

It works in QV9 SR6, 64 bits. And QV10 32 bits

-Alex



[map SK123-456]:
MAPPING LOAD * INLINE [
Kode, ID
one, 1
two, 2
three, 3
];

T1:
LOAD * INLINE [
Kode, Segment
one, a
two, b
three, c
];


T2:
LOAD
Kode as OrigKode,
applymap('map SK123-456', Kode) as ID,
Segment
resident T1;




Not applicable
Author

Alex,

By looking at your code I see my mistake. I have used the ' ' and [ ] wrong.

I called the map with

applymap('[map SK02-21]', Kode1)

but the correct syntax should be

applymap('map SK02-21', Kode1)

Thank you for your feedback.

Not applicable
Author

Hi Roland,

I'm aware of the automatic drop of mapping tables, but the customer is to handle the development and manage the scripts in the future. That's why naming is important in this case. I could off course used underscore (_) or similar, but it was frustrating not manage to put minus (-) in my script.

I notice you start your snipplet with defining the table name with [tablename] , but continue using the 'tablename' , does it matter which one you choose? Is any of the two to prefer?

Not applicable
Author

Hi Vegar,

no, as far as I know they are equal. May be in a dark und dusty corner of QV they differ.

The usage is more a matter of taste, of course in a normal script I am using only one of them continously.

Enjoy QV, Roland