Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
cedfoning
Creator
Creator

Insert Data in column

Hello, i need help please : 

i have the following data : 

ORD_Number MOV_Material  MOV_Reference 
5102742773 5009583994 76840059
  4041989847 76840059006_0393
  4041989973 76840059007_0393
  4041990003 76840059002_0393

 

FOr exemple, i passed a command with mov_reference 76840059, that generated me a ORD_Number 5102742773. 

Later on, i had a problem with my command (76840059). i created 3 new lines (76840059006_0393, 76840059007_0393, 76840059002_0393) that represents the Mov_Reference of each problem i had. By Default, there is no ORD_Number Attached to theses lines. 

Also note that the first 8 caracters of these 3 lines represents the initial mov_reference 76840059.

Note that this is just an example, i have many commands in my data source

In qlik, i want a code that will help me replace the empty values or null values in ORD_Number by that of the original MOV_Reference, for each MOV_Reference

here is the result at the end : 

ORD_Number MOV_Material  MOV_Reference 
5102742773 5009583994 76840059
5102742773 4041989847 76840059006_0393
5102742773 4041989973 76840059007_0393
5102742773 4041990003 76840059002_0393


 

Labels (2)
1 Reply
BrunPierre
Partner - Master
Partner - Master

One way could be this.

Temp:
LOAD ORD_Number,
MOV_Material,
MOV_Reference
From ... ;

MapON:
Mapping LOAD Left(MOV_Reference,8),
ORD_Number
Resident Temp
Where not IsNull(EmptyIsNull(ORD_Number));

NoConcatenate
Data:
LOAD ApplyMap('MapON',Left(MOV_Reference,8)) as ORD_Number,
MOV_Material,
MOV_Reference
Resident Temp;

DROP Table Temp;