Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
Please find the attached file (which contains sample source file and example for required output).
Please help me to create a column from the below source file using 'START_RANGE' & 'END_RANGE'.
I need to generate a table like below (Just given a sample for first 4 Rows)
Thanks in advance!!!
Hi,
Check this..
Directory;
T1:
LOAD Col1,
Col2,
Col3,
Col4,
Col5,
Col6,
Col7,
Col8,
Col9,
Col10,
Col11,
Col12,
START_RANGE,
END_RANGE,
F15
FROM
source.xlsx
(ooxml, embedded labels, table is [sample date]);
NoConcatenate
T2:
LOAD *,RowNo() as Key,Num(END_RANGE)-Num(START_RANGE) as Count Resident T1 Where not IsNull(Col2);
DROP Table T1;
Final:
LOAD * Inline [
Temp
''
];
for i = 1 to NoOfRows('T2')
Let vCount=Peek('Count',i-1,'T2');
for j=1 to $(vCount)+1
Concatenate(Final)
LOAD *,Num(START_RANGE+$(j)-1,Repeat('0',Len(START_RANGE))) as Result Resident T2 Where Key=$(i);
Next j
Next i
DROP Table T2;
DROP Field Temp,Key,Count;
Check the Attachment.
Hi,
Check this..
Directory;
T1:
LOAD Col1,
Col2,
Col3,
Col4,
Col5,
Col6,
Col7,
Col8,
Col9,
Col10,
Col11,
Col12,
START_RANGE,
END_RANGE,
F15
FROM
source.xlsx
(ooxml, embedded labels, table is [sample date]);
NoConcatenate
T2:
LOAD *,RowNo() as Key,Num(END_RANGE)-Num(START_RANGE) as Count Resident T1 Where not IsNull(Col2);
DROP Table T1;
Final:
LOAD * Inline [
Temp
''
];
for i = 1 to NoOfRows('T2')
Let vCount=Peek('Count',i-1,'T2');
for j=1 to $(vCount)+1
Concatenate(Final)
LOAD *,Num(START_RANGE+$(j)-1,Repeat('0',Len(START_RANGE))) as Result Resident T2 Where Key=$(i);
Next j
Next i
DROP Table T2;
DROP Field Temp,Key,Count;
Check the Attachment.
HI
Thank you so much
hi Settu thanks
i have one more issue when i am trying to create a 'start range' and 'end range' getting the issue below. please advise
Hi,
Can you post your qvw which is not working?
May be check the attachment.. i just did a small change in the previous script..