Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
krish2459
Creator
Creator

row level source and destination

Hi,

I'm attaching some sample data in the sheet "Source Data" and rquied output in the sheet "Required Output".

Please see the highlited column in the "Required Output" sheet.

Finally I want to create destination latitude and longitues using soure co-ordinates.

 

Thanks,

Krish

Labels (1)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

I recommend yo do this in the script. Load the excel/source like below.

TMP:
LOAD
   
lattitude,

   Longitude,
   Source,
   Destination,
   RecNo() as RowID
FROM [Book1.xlsx] (ooxml, embedded labels, table is [Source Data])
;

FINAL:
LOAD
   RowID,
   lattitude,
   Longitude,
   Source,
   Destination,
   IF(Destination = Peek('Destination'), peek('lattitude') , null()) as [Lattitude destination],
   IF(Destination = Peek('Destination'), peek('Longitude') , null()) as [Longitude destination]
Resident TMP
Order By RowID Desc
;
DROP TABLE TMP;

View solution in original post

1 Reply
Vegar
MVP
MVP

I recommend yo do this in the script. Load the excel/source like below.

TMP:
LOAD
   
lattitude,

   Longitude,
   Source,
   Destination,
   RecNo() as RowID
FROM [Book1.xlsx] (ooxml, embedded labels, table is [Source Data])
;

FINAL:
LOAD
   RowID,
   lattitude,
   Longitude,
   Source,
   Destination,
   IF(Destination = Peek('Destination'), peek('lattitude') , null()) as [Lattitude destination],
   IF(Destination = Peek('Destination'), peek('Longitude') , null()) as [Longitude destination]
Resident TMP
Order By RowID Desc
;
DROP TABLE TMP;