Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to merge data

i want to merge the data below 2 into one row of record according to the timeframe of starttime and endtime ,

for one example, the same person has 2 records, but the second row's starttime and endtime is contained in the firstrow's time frame

Member_idStartDateStartTimeEndTime
3194581/9/2013 0:001/9/2013 17:001/9/2013 22:00
3194581/9/2013 0:001/9/2013 18:001/10/2013 19:00

so i want to merge the above two row into one row and discard the second row, how to do it in Qlikview?

3194581/9/2013 0:001/9/2013 17:001/9/2013 22:00

i want to all the cases like above example to merge into one row per the largest  timeframe of starttime and endtime per same memberid on the same date

another example

Member_idStartDateStartTimeEndTime
3194581/10/20131/9/2013 17:001/9/2013 22:00
3194581/10/20131/9/2013 19:001/10/2013 23:00

merged into

Member_idStartDateStartTimeEndTime
3194581/10/20131/9/2013 17:001/9/2013 23:00
5 Replies
Not applicable
Author

Hi Max,

In the script, do a group by Member_id and StartDate and calculate the min StartTime value and the max EndTime value.

For example,

Load Member_id,

    StartDate,

     min(StartTime) as StartTime,

     max(EndTime) as EndTime

Resident Table

Group by

     Member_id,

     StartDate;

Karl

Not applicable
Author

sorry, i want to meger only timeframe that have crossed each other

Member_id
StartDateStartTimeEndTimeROW number
3194581/10/20131/9/2013 17:001/9/2013 22:001
3194581/10/20131/9/2013 19:001/10/2013 23:00  2
3194581/10/20131/9/2013 7:001/9/2013 9:003

the row number 3 what i do not need to meger, the row 1,2 that need to merge into one due to cross of time

Not applicable
Author

who can help me

preminqlik
Specialist II
Specialist II

hi there,

tab:

LOAD

    MEMBER_ID, st.Date, StartDate, EndDate, RowNum

from ......

tab2:

NoConcatenate

load MEMBER_ID,st.Date,

min(RowNum) as RowNum

Resident tab Group by MEMBER_ID,st.Date;

left join

LOAD *

Resident tab;

DROP table tab;

find attachment

Regards

premhas

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See attached qvw


talk is cheap, supply exceeds demand