Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Aldemarprins4
Contributor III
Contributor III

Couples with multiple stages

Hello friends, I have a problem with some transactions, and it has to have a start stage (1. Process) and two output stages, a main output stage (2 Distribution) and the other alternate (3 Distribution), the Alternative stage should only be used when the main stage is null, that is, it is not found in the file.

 

The pairs should be as follows:


Arrival                                    Stage                      Departure
02/11/2021 13:31:27      1. Process              02/11/2021 14:11:38
02/11/2021 14:12:02      1. Process              02/11/2021 14:12:03
02/11/2021 14:18:27      2 Distribucion      02/11/2021 14:18:28

 
02/11/2021 14:50:42       1. Process            02/11/2021 15:03:51
02/11/2021 15:10:41       3 Distribucion     02/11/2021 15:10:42

02/11/2021 16:31:27       1. Process             02/11/2021 16:11:38
02/11/2021 17:12:02       1. Process             02/11/2021 17:12:03
02/11/2021 18:18:27      2 Distribucion     02/11/2021 18:18:28

All the information is in a single file and is organized by the order of arrival

Labels (3)
1 Reply
Aldemarprins4
Contributor III
Contributor III
Author

I have this code but it only takes one stage, that is, the main one, when I put the second stage it does not work for me because the other stage appears

alt(Peek(Pareja),1)-(Stage ='1. Process' and Previous(Stage )=2 Distribucion) as Pareja

 

I don't know if you understand me or if you require any additional information