Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
yes, its working. Thanks for the solution.
Results with a little change:
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;
thanks