Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I need to change my database model, this is my data right now:
ID | departure | arrival | Place |
5567 | 16.04.2018 08:30 | Place 1 | |
5567 | 16.04.2018 08:42 | 16.04.2018 08:42 | Place 2 |
5567 | 16.04.2018 08:45 | 16.04.2018 08:45 | Place 3 |
5567 | 16.04.2018 09:16 | 16.04.2018 09:16 | Place 4 |
5567 | 16.04.2018 09:38 | 16.04.2018 09:38 | Place 5 |
5567 | 16.04.2018 10:46 | 16.04.2018 09:40 | Place 6 |
5567 | 16.04.2018 11:00 | 16.04.2018 10:59 | Place 7 |
5567 | 16.04.2018 12:12 | Place 8 |
I need a table like this:
ID | departure | arrival | Place_from | Place_to |
5567 | 16.04.2018 08:30 | 16.04.2018 08:42 | Place 1 | Place 2 |
5567 | 16.04.2018 08:42 | 16.04.2018 08:45 | Place 2 | Place 3 |
5567 | 16.04.2018 08:45 | 16.04.2018 09:16 | Place 3 | Place 4 |
5567 | 16.04.2018 09:16 | 16.04.2018 09:38 | Place 4 | Place 5 |
5567 | 16.04.2018 09:38 | 16.04.2018 09:40 | Place 5 | Place 6 |
5567 | 16.04.2018 10:46 | 16.04.2018 10:59 | Place 6 | Place 7 |
5567 | 16.04.2018 11:00 | 16.04.2018 12:12 | Place 7 | Place 8 |
How can I change the data in Qlikview?
Thank you for you help!
Hello, Alexander Müller!
Is this what you are looking for?
Data:
Load *
Inline
[ID, departure, arrival, Place
5567, 16.04.2018 08:30, , Place 1
5567, 16.04.2018 08:42, 16.04.2018 08:42, Place 2
5567, 16.04.2018 08:45, 16.04.2018 08:45, Place 3
5567, 16.04.2018 09:16, 16.04.2018 09:16, Place 4
5567, 16.04.2018 09:38, 16.04.2018 09:38, Place 5
5567, 16.04.2018 10:46, 16.04.2018 09:40, Place 6
5567, 16.04.2018 11:00, 16.04.2018 10:59, Place 7
5567, , 16.04.2018 12:12, Place 8
];
FinalData:
Load ID,
departure,
FieldValue('arrival',RowNo() + 1) As arrival,
Place As Place_From,
FieldValue('Place',RowNo() + 1) As Place_To
Resident Data
Where Len(departure) > 0;
Drop Table Data;
Use Peek or Previous
Hello, Alexander Müller!
Is this what you are looking for?
Data:
Load *
Inline
[ID, departure, arrival, Place
5567, 16.04.2018 08:30, , Place 1
5567, 16.04.2018 08:42, 16.04.2018 08:42, Place 2
5567, 16.04.2018 08:45, 16.04.2018 08:45, Place 3
5567, 16.04.2018 09:16, 16.04.2018 09:16, Place 4
5567, 16.04.2018 09:38, 16.04.2018 09:38, Place 5
5567, 16.04.2018 10:46, 16.04.2018 09:40, Place 6
5567, 16.04.2018 11:00, 16.04.2018 10:59, Place 7
5567, , 16.04.2018 12:12, Place 8
];
FinalData:
Load ID,
departure,
FieldValue('arrival',RowNo() + 1) As arrival,
Place As Place_From,
FieldValue('Place',RowNo() + 1) As Place_To
Resident Data
Where Len(departure) > 0;
Drop Table Data;