Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I need to convert the table 01 to table 02. Pease let me know if you have any suggestions. I tried to use FOR loop but failed. Would really appreciate if anyone could assist me asap. Thanks, Hansika
Try this?
LOAD Time,
Resource,
RowNo() AS RowNum,
IF(Len(Period) = 0, Peek('Period'), Period) AS Period;
LOAD Time,
IF(Subfield(Resource,':',1) = 'Period', '', Resource) AS Resource,
RowNo() AS RowNum,
IF(Len(Time)>0, '', Resource) AS Period;
LOAD * INLINE [
Resource, Time
Period:7/30/2016-8/05/2016,
A,8
B,8
Period:9/30/2016-11/05/2016
A,8
B,8
C,8
];
Try this?
LOAD Time,
Resource,
RowNo() AS RowNum,
IF(Len(Period) = 0, Peek('Period'), Period) AS Period;
LOAD Time,
IF(Subfield(Resource,':',1) = 'Period', '', Resource) AS Resource,
RowNo() AS RowNum,
IF(Len(Time)>0, '', Resource) AS Period;
LOAD * INLINE [
Resource, Time
Period:7/30/2016-8/05/2016,
A,8
B,8
Period:9/30/2016-11/05/2016
A,8
B,8
C,8
];