Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
gopal5879
Creator
Creator

QLIKVIEW script - Need help in transforming data , based on Sample work data Need output as in JPG

Hello folks,

I have sample input data as below

Need output as show in screen shot attached jpg file .  I need to do this using  QlikView script , any help is highly appreciated as I am running under tight deadline of project

14 Replies
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Replace the seqkey with timestamp and see if it works

StarinieriG
Partner - Specialist
Partner - Specialist

Hi 

try to do something like this:

NoConcatenate
START:
LOAD *,
RowNo() as ID,
If(Previous(status)=status,status & RowNo(),status) as Dimension;
LOAD
status,
date as start
Resident TABLE
Where Index(rec_status,'start')>0
Order By status,date
;


Left Join
LOAD
RowNo() as ID,
If(Previous(status)=status,status & RowNo(),status) as Dimension,
end
;
LOAD
status,
date as end
Resident TABLE
Where Index(rec_status,'end')>0
Order By status,date
;

DROP Table TABLE;

gopal5879
Creator
Creator
Author

Thanks a lot, I will try

Brett_Bleess
Former Employee
Former Employee

Gopal, just wanted to see if you got things figured out here?  If so, be sure to use the Accept as Solution button on any of the posts from folks that helped you get things working.  If you did something different, consider posting that and then mark that as the solution so others will know what worked.  If you still need help, drop an update on where things stand.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
qliksus
Specialist II
Specialist II

Create a group based on the each start and end and do the max and min based on that group 

 

clar:
LOAD * INLINE [
F1, F2, F3
Clarification Start, Clarification, 1/1/2018
, Clarification, 1/4/2018
Clarification End, Clarification, 1/2/2018

Maintenance Start, Maintenance, 1/5/2018
, Maintenance, 1/6/2018
Maintenance End, Maintenance, 1/7/2018
Maintenance Start, Maintenance, 1/8/2018
, Maintenance, 1/9/2018
, Maintenance, 1/10/2018
, Maintenance, 1/11/2018
Maintenance End, Maintenance, 1/12/2018
];

load

* ,

if( RowNo()=1 ,1 ,
if( wildmatch(F1,'*Start*') or IsNull(Peek(F1)) , peek(row)+1, peek(row) )) as row

Resident clar ;

DROP Table clar;

 

Calulate Min/Max based on row and F2 field