Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Group data by consecutive dates

I got this requirement from the business which is quite tricky, and I would like to know whether it is possible to handle with Qlikview (if yes, in which stage) or not since I started to know Qlikview a month ago only.

The table stores the events with:

Event_ID (unique number), Event_Description, Event_Organiser, Event_Date

Event_IDEvent_DescriptionEvent_OrganiserEvent_Date
1AX08.07.2014
2AX09.07.2014
3AX10.07.2014
4BY12.07.2014
5AX15.07.2014

An entry is created in the DB per event and per day and we need to regroup the events by the consecutive days, which means,

if the event has the same description and organiser, we take the consecutive dates and consider that the event last for N days

The required outcome is as following (if possible assign a group ID which is the "real" Event ID and not the numeric one generated by the DB)

Event_Description  Event_Organiser  Event_Date

A                              X                          08.07.2014-10.07.2014

A                              X                          15.07.2014

B                              Y                          12.07.2014

Thank you for any suggestion

15 Replies
MK_QSL
MVP
MVP

Have you tried my one? 🙂

Not applicable
Author

Hi all, many thanks for your suggestion. I finish my working day now (was busy to solve some issues) and did not have time to try all proposals yet. Please let me sometime (also I am slow as beginner ). I don't have Qlik at home to work with so it will be next Monday

Wish you good weekend

Not applicable
Author

Hello Manish, I'm sorry to disappoint you but I did follow the solution from Massimo since it's bright clear to understand (no usage of SubField or RowNum, ....) and I will not have time to test your proposal. Thank you and best wishes

Not applicable
Author

Hi Massimo, thank you again for your solution that I appreciated alot for many reasons:

- create a key field (NEW) for comparaison (indeed I have more than 10 fields to compare .-)

- Add additional column to combine the ID and dates

MK_QSL
MVP
MVP

As far as you got answer is fine to me.  Community members satisfaction is more important than my point. 

Not applicable
Author

Response appreciated 😉