Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have this data format:
Key | Timestamp | Name |
---|---|---|
12345 | 01.02.2017 05:00 | Alex |
12345 | 01.02.2017 05:30 | |
12345 | 02.02.2017 03:46 | |
12345 | 02.02.2017 17:02 | Alex |
54321 | 07.02.2017 18:23 | Peter |
98765 | 13.02.2017 20:45 | Alex |
I want to fill up the Name between the timestamp.
order by the key and timestamp.
I hope someone can help me
Thanks!
Data:
load
Key,
Timestamp,
if(Key = peek('Key') and isnull(Name),peek('Name'),Name) as Name
from yourDB
order by Key, Timestamp;
Data:
load
Key,
Timestamp,
if(Key = peek('Key') and isnull(Name),peek('Name'),Name) as Name
from yourDB
order by Key, Timestamp;
Hi Alexander,
If I understand you correctly, maybe something like this?
Table1:
LOAD Key,
If(Key=Previous(Key), 1, 2) as ID_Key,
Timestamp,
Name
FROM
Book1.xlsx
(ooxml, embedded labels, table is Sheet1, filters(
Replace(1, top, StrCnd(null)),
Replace(3, top, StrCnd(null))
));
NoConcatenate
TableFinish:
LOAD
If(IterNo()=ID_Key, Key) as Key,
If(IterNo()=ID_Key, Timestamp(Timestamp), Name) as Timestamp
Resident Table1
While IterNo()<=ID_Key;
DROP Table Table1;
Result
Format Timestamp determine what you need.
Regards,
Andrey
Hello,
i want to have this:
Key | Timestamp | Name |
---|---|---|
12345 | 01.02.2017 05:00 | Alex |
12345 | 01.02.2017 05:30 | Alex |
12345 | 02.02.2017 03:46 | Alex |
12345 | 02.02.2017 17:02 | Alex |
54321 | 07.02.2017 18:23 | Peter |
98765 | 13.02.2017 20:45 | Alex |
If there is in same 'Key' two lines with the same "Name" and empty 'Name' between the 'Timestamp', it should fill up the "Name".
Thank you
HI,
PFA fr the same..
Check the script aswell ..Data also attached in excel sheet 2
Sachin
Find excel as well..Sorry I think I missed excel attachment..
Sachin
Hi,
load
Key,
Timestamp,
if(isnull(Name),Peek(Name),Name) as Name
resident main_table
order by Key,Timestamp;
Hope it will work
Thank you
I had to use len(Name) = 0
Its better to use
if(len(Trim(Name)) = 0)
Make sure to use trim to avoid necessary spaces..