Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
anya
Contributor III
Contributor III

how to repeat the value in loading script

hello expert, i have a file like this table

Objectattributevalue
Ballcolorred
 diameter10 cm
 height100 cm
Boxcolorblack
 length20 cm
 height16 cm

 

table that i want 

Objectattributevalue
Ballcolorred
 Balldiameter10 cm
Ball height100 cm
Boxcolorblack
Box length20 cm
Box height16 cm

 How am i supposed to do that?

Please Suggest.

 

thanks

4 Replies
santhiqlik
Creator
Creator

Hi,
Try this in your load script..
If(IsNull(Object), Previous (Object),Object) as Object
avinashelite

Try like this 

 

if(len(trim(Object))=0,Previous(Object),Object) as Object

Frank_Hartmann
Master II
Master II

or maybe this to also cover emptystrings:

if(len(trim(Object))=0, peek('Object', - 1),Object) as Object
OmarBenSalem

Please, do as follow:

 

Table:
load if(len(trim(Object))>0,RowNo(), peek('Flag')) as Flag , Object,attribute, value Inline [
Object, attribute, value
Ball, color, red
,diameter, 10 cm
,height, 100 cm
Box ,color, black
,length, 20 cm
,height ,16 cm
];

Mapping:
Mapping load Flag,Object Resident Table;

 

Final:

load ApplyMap('Mapping',Flag) as Object,
attribute,
value
Resident Table;
drop Field Flag;
drop Table Table;

 

Result:

Capture.PNG