Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
d_ankusha
Creator II
Creator II

Load Inline

Hi,

I have a load statement:

Temp:

Load * Inline [

temp

a

b

ccc

];

I want output:

temp

a

b

c

c

c

This should happen for every next value added in inline.

Can anyone suggest a solution for this. I tried using left() and keepchar() but my logic is not working out.

12 Replies
d_ankusha
Creator II
Creator II
Author

yes, its working. Thanks for the solution.

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Results with a little change:

Screenshot_2.jpg

The code:

Temp:

Load * Inline [

temp

a

b

ccc

def

];

NoConcatenate

tmp:

LOAD *

,Len(temp) as Lenght

,RowNo() as Row

Resident Temp;

DROP Table Temp;

LET TotalRow = Peek('Row', -1, 'tmp');

FOR i = 1 to $(TotalRow)

NoConcatenate

tmp2:

LOAD *

Resident tmp

Where Row = $(i)

;

vLenght = Peek('Lenght');

vTemp = Peek('temp');

Data:

LOAD Mid('$(vTemp)', RecNo(), 1) as NewTemp

,'$(vTemp)' as Temp

,'$(vLenght)' as Lenght

AutoGenerate $(vLenght);

DROP Table tmp2;

NEXT i

DROP Table tmp;

exit script;

d_ankusha
Creator II
Creator II
Author

thanks