Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
AlexWest
Creator
Creator

Mapping ignores values in SQL load

Hi Guys!

I have the following script:

1.Section "SQL load":

LIB CONNECT TO 'Oracle_base';

[All_packs]:
SQL
select

field1

,field2

,DIVISION2

,field3

from TABLE1

;

2. Section "MAPPING"

[Branch_mapping]:
MAPPING LOAD * INLINE
[
from|to
030102|City1
050101|City2
050201|City3
090101|City4
](delimiter is |);

3. Section "Qlik sense Load"

[All_packs_adv]:
NoConcatenate Load
field1
,field2
,ApplyMap('Branch_mapping'DIVISION2) as DIVISION2
,field5
Resident All_packs;
drop table All_packs;

 

So, I have no any error! All loads well.

But in the end, when I see the DIVISION2 field in filter or anywere, I just see the number, but not like "City1".

AlexWest_0-1676282678645.png

 

Maybe someone have an idea, why does Qlik sense ignores the mapping?

Labels (2)
1 Solution

Accepted Solutions
Or
MVP
MVP

For consistency, I'd suggest applying either num#() or text() to both sides. Note that it's typically a good idea to do this in the Load section, so you'll want to add one of those to your SQL.

View solution in original post

5 Replies
Or
MVP
MVP

Those are strings, not numbers (you can tell because they're justified to the left rather than the right). Make sure your data types are identical on both sides of the load and it'll presumably work correctly.

AlexWest
Creator
Creator
Author

Hi!

You mean that I need to apply a TEXT function to the DIVISION2 field? Or num-function?

Or
MVP
MVP

For consistency, I'd suggest applying either num#() or text() to both sides. Note that it's typically a good idea to do this in the Load section, so you'll want to add one of those to your SQL.

AlexWest
Creator
Creator
Author

Thanks a lot for your suggestions! 

But could you please give a syntax, where exactly I should use text() or num#(), to what both sides I have to use one of these functions? 

Sorry about that, I'm really newbie in Qlik 😅

Or
MVP
MVP

Load Text(DIVISION2) as DIVISION2, OtherFieldsHere;

SQL Select SomeFields from SomeTable;

 

Mapping Load Text(from) as from, to

From SomeTable2;