Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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 |
Results:
START | END |
---|---|
01/01/2017 | 31/12/2017 |
05/11/2017 | 30/06/2018 |
01/01/2018 | 31/01/2019 |
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;
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;
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:
expected results:( i want out put like below)
You can just add the needed lines to a new Qlikview application and test it, just paste the code you have in there.
Felipe.
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;
You're right Rakesh,
I forgot to order the dates, since they were ordered on the inline load it worked.
Thanks .
Thanks Felip
Its working fine
Thanks Rakesh...