Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Qlik-Experts,
Is it possible to find out exactly which lines do not correspond to a cyclic structure?
As a small example, I have set up a simulated scenario where staff track their time. Where G = Go and K = Come to work.
In this example, Roman has logged out before he has even started working. This is incorrect information and should therefore be deleted from the data model.
When you concatenate all the CBUCHUNGSZEITPUNKT togetether it should looks like this:
KGKGKGKGKG (meaning starting with K and ending with G)
Hopefully you can help me!
This works:
Binary [lib://Documents/Qlik/Sense/Apps/Timestamp.qvf];
Rename Table LANDWEHRZEITERFINTERN_FINAL to LANDWEHRZEITERFINTERN;
Drop Fields
[First Check],
[Final Check]
From LANDWEHRZEITERFINTERN;
LANDWEHRZEITERFINTERN_TMP:
NoConcatenate
Load *,
if(IPERSONALNR<>peek(IPERSONALNR) and CBUCHUNGSTYP='G','To Be Deleted','OK') as [First Check]//Check if starts with G
Resident LANDWEHRZEITERFINTERN
Order by IPERSONALNR,DBUCHUNGSZEITPUNKT asc;
Drop Tables LANDWEHRZEITERFINTERN;
LANDWEHRZEITERFINTERN_FINAL:
NoConcatenate
Load *,
if([First Check]='To Be Deleted' or IPERSONALNR<>peek(IPERSONALNR) and CBUCHUNGSTYP='K','To Be Deleted','OK') as [Final Check] //Check if ends with K
Resident LANDWEHRZEITERFINTERN_TMP
Order by IPERSONALNR,DBUCHUNGSZEITPUNKT desc;
Drop Field [First Check];
Drop Table LANDWEHRZEITERFINTERN_TMP;
And the result is:
If you want to exclude "To be Deleted" rows just perform a resident load Where [Final Check]<>'To Be Deleted'
This works:
Binary [lib://Documents/Qlik/Sense/Apps/Timestamp.qvf];
Rename Table LANDWEHRZEITERFINTERN_FINAL to LANDWEHRZEITERFINTERN;
Drop Fields
[First Check],
[Final Check]
From LANDWEHRZEITERFINTERN;
LANDWEHRZEITERFINTERN_TMP:
NoConcatenate
Load *,
if(IPERSONALNR<>peek(IPERSONALNR) and CBUCHUNGSTYP='G','To Be Deleted','OK') as [First Check]//Check if starts with G
Resident LANDWEHRZEITERFINTERN
Order by IPERSONALNR,DBUCHUNGSZEITPUNKT asc;
Drop Tables LANDWEHRZEITERFINTERN;
LANDWEHRZEITERFINTERN_FINAL:
NoConcatenate
Load *,
if([First Check]='To Be Deleted' or IPERSONALNR<>peek(IPERSONALNR) and CBUCHUNGSTYP='K','To Be Deleted','OK') as [Final Check] //Check if ends with K
Resident LANDWEHRZEITERFINTERN_TMP
Order by IPERSONALNR,DBUCHUNGSZEITPUNKT desc;
Drop Field [First Check];
Drop Table LANDWEHRZEITERFINTERN_TMP;
And the result is:
If you want to exclude "To be Deleted" rows just perform a resident load Where [Final Check]<>'To Be Deleted'
Thank you this works for me!