Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Schnuber
Contributor
Contributor

Convert List of Timestamps and Events to Table

Hi everyone,

i like to convert a list of Order-IDs with corresponding Events and Event-Timestamps to a Table View like in this example.

FROM:Order-IDEvent-TimestampEvent-Type 
 116.05.20 17:35Request 
 216.05.20 17:50Request 
 117.05.20 07:50Accepted 
 317.05.20 08:00Request 
 217.05.20 08:05Accepted 
 117.05.20 08:15Send 
 317.05.20 08:33Accepted 
 317.05.20 09:12Send 
 217.05.20 11:03Send 
     
TO:Order-IDEvent-Type: RequestEvent-Type: AcceptedEvent-Type: Send
 116.05.20 17:3517.05.20 07:5017.05.20 08:15
 216.05.20 17:5017.05.20 08:0517.05.20 09:12
 317.05.20 08:0017.05.20 08:3317.05.20 11:03

 

Can you help me with that?

I am new to Qlik. Please excuse if this is easy to solve or an RTFM question for which I have not found the right chapter. 🙂

1 Solution

Accepted Solutions
marcel_olmo
Partner Ambassador
Partner Ambassador

Hi @Schnuber ,

here you have the code :

FromOrders:

LOAD * INLINE [

FROM:, Order-ID, Event-Timestamp, Event-Type,
, 1, 16.05.20 17:35, Request,
, 2, 16.05.20 17:50, Request,
, 1, 17.05.20 07:50, Accepted,
, 3, 17.05.20 08:00, Request,
, 2, 17.05.20 08:05, Accepted,
, 1, 17.05.20 08:15, Send,
, 3, 17.05.20 08:33, Accepted,
, 3, 17.05.20 09:12, Send,
, 2, 17.05.20 11:03, Send
];

store FromOrders into FromOrders.qvd;

drop Table FromOrders;


ToOrders:

load Distinct

'' as "TO:",
"Order-ID" as "Order-ID",
"Event-Timestamp" as "Event-Type: Request"
FROM
[FromOrders.qvd]
(qvd)

Where "Event-Type" = 'Request';

join

load Distinct

'' as "TO:",
"Order-ID" as "Order-ID",
"Event-Timestamp" as "Event-Type: Accepted"
FROM
[FromOrders.qvd]
(qvd)

Where "Event-Type" = 'Accepted';

join

load Distinct

'' as "TO:",
"Order-ID" as "Order-ID",
"Event-Timestamp" as "Event-Type: Send"
FROM
[FromOrders.qvd]
(qvd)

Where "Event-Type" = 'Send';

 

Best regards, Marcel.

View solution in original post

1 Reply
marcel_olmo
Partner Ambassador
Partner Ambassador

Hi @Schnuber ,

here you have the code :

FromOrders:

LOAD * INLINE [

FROM:, Order-ID, Event-Timestamp, Event-Type,
, 1, 16.05.20 17:35, Request,
, 2, 16.05.20 17:50, Request,
, 1, 17.05.20 07:50, Accepted,
, 3, 17.05.20 08:00, Request,
, 2, 17.05.20 08:05, Accepted,
, 1, 17.05.20 08:15, Send,
, 3, 17.05.20 08:33, Accepted,
, 3, 17.05.20 09:12, Send,
, 2, 17.05.20 11:03, Send
];

store FromOrders into FromOrders.qvd;

drop Table FromOrders;


ToOrders:

load Distinct

'' as "TO:",
"Order-ID" as "Order-ID",
"Event-Timestamp" as "Event-Type: Request"
FROM
[FromOrders.qvd]
(qvd)

Where "Event-Type" = 'Request';

join

load Distinct

'' as "TO:",
"Order-ID" as "Order-ID",
"Event-Timestamp" as "Event-Type: Accepted"
FROM
[FromOrders.qvd]
(qvd)

Where "Event-Type" = 'Accepted';

join

load Distinct

'' as "TO:",
"Order-ID" as "Order-ID",
"Event-Timestamp" as "Event-Type: Send"
FROM
[FromOrders.qvd]
(qvd)

Where "Event-Type" = 'Send';

 

Best regards, Marcel.