Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
gireesh1216
Creator II
Creator II

Need help

Hi Team,

I have data like below:

In below data END column have 31/01/2019 two times and START column have two different dates(01/01/2018,05/03/2018)

Hear 05/03/2018 date is part of (01/01/2018 to 31/01/2019).So I want to include 05/03/2018 into 01/01/2018.

if I select 01/01/2018 in filter, Need to display 01/01/2018 data and 05/03/2018 data in straight table.

STARTEND
01/01/201731/12/2017
05/11/201730/06/2018
01/01/201831/01/2019
05/03/201831/01/2019

Results:

STARTEND
01/01/201731/12/2017
05/11/201730/06/2018
01/01/201831/01/2019
1 Solution

Accepted Solutions
boorgura
Specialist
Specialist

Just a minor change to this should get the desired output:

x:

Load * Inline

[

START,END

01/01/2017,31/12/2017

05/11/2017,30/06/2018

01/01/2018,31/01/2019

05/03/2018,31/01/2019

];

NoConcatenate

y:

Load

END,

// search for a same end date and marks it to be removed after

if(END = peek(END),peek(START),START) as START;

Load

START,

END

Resident x

order by START;

drop table x;

View solution in original post

7 Replies
felipedl
Partner - Specialist III
Partner - Specialist III

Hi gireesh,

The following code will do the trick:

x:

Load * Inline

[

START,END

01/01/2017,31/12/2017

05/11/2017,30/06/2018

01/01/2018,31/01/2019

05/03/2018,31/01/2019

];

NoConcatenate

y:

Load

START,

END

where [Remove Date]=0;

Load

START,

END,

// search for a same end date and marks it to be removed after

if(END = peek(END),1,0) as [Remove Date];

Load

START,

END

Resident x

order by START;

drop table x;

gireesh1216
Creator II
Creator II
Author

Its working fine .But data is missing in this logic

can u please check this

x:

Load * Inline

[

START,END,A

01/01/2017,31/12/2017,1

05/11/2017,30/06/2018,2

01/01/2018,31/01/2019,3

05/03/2018,31/01/2019,4

];

NoConcatenate

y:

Load

START,

END,

A

where [Remove Date]=0;

Load

START,

END,

A,

// search for a same end date and marks it to be removed after

if(END = peek(END),1,0) as [Remove Date];

Load

START,

END,

A

Resident x

order by START;

drop table x;

results:

testing.PNG

expected results:( i want out put like below)

testing.PNGtesting.PNG

felipedl
Partner - Specialist III
Partner - Specialist III

You can just add the needed lines to a new Qlikview application and test it, just paste the code you have in there.

Felipe.

boorgura
Specialist
Specialist

Just a minor change to this should get the desired output:

x:

Load * Inline

[

START,END

01/01/2017,31/12/2017

05/11/2017,30/06/2018

01/01/2018,31/01/2019

05/03/2018,31/01/2019

];

NoConcatenate

y:

Load

END,

// search for a same end date and marks it to be removed after

if(END = peek(END),peek(START),START) as START;

Load

START,

END

Resident x

order by START;

drop table x;

felipedl
Partner - Specialist III
Partner - Specialist III

You're right Rakesh,

I forgot to order the dates, since they were ordered on the inline load it worked.

Thanks .

gireesh1216
Creator II
Creator II
Author

Thanks Felip

Its working fine

gireesh1216
Creator II
Creator II
Author

Thanks Rakesh...