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: 
qlikmark1990
Contributor III
Contributor III

Join and create new table with IntervalMatch

I am analyzing dummy data about patient occupancy in an institute. A part of the data that I have is:

          

PatiëntAchternaamPatiëntGeboortedatumPatiëntGeslachtPatiëntIdPatiëntLandPatiëntVoornaamVerblijfStartVerblijfEindVerblijfStartNumVerblijfEindNum
Aarle18-5-1999man8NederlandErwin3-6-20153-8-20154215842219
Alink8-11-1987man24NederlandReinier29-1-20174-7-20174276442920
Aris8-9-2000man30NederlandMeine28-2-20179-9-20174279442987
Assink6-3-1993vrouw22NederlandRobin19-3-201718-10-20174281343026
Assink4-10-2000man10NederlandLeonard11-11-201625-11-20164268542699
Borst4-8-2001man5BelgieJoost22-3-201516-4-20154208542110
Bouwmeester9-9-1977man1NederlandKoen1-1-201515-2-20154200542050
Brons18-1-1989man25NederlandRoos1-1-20168-1-20164237042377
Craig1-1-1977vrouw29AustraliëBrittany7-5-20176-3-20174286242800

I try to make a new table that contains the complete range of NumDate and for each day the number of patients that are present. Before I could sold with a Python script but now I want to do this in QLikView itself. A part of the data presentation that I want is :

 

DatumNumPatiëntId
420051
420061
420071
420081
420091
420101
420111
420121
420131
420141
420151
420161
420171
420181
420191
420201
420211
420221
420231
420241
420251
420261
420271
420281
420291
420301
420311
420321
420331
420341
420351
420361
420371
4203713
4203728
420381
4203813
4203828
420391
4203913
4203928

As shown, there is one patient present from 42005 until 42036 and from 42037 and on there are three patients present, given by the patientId.

So far, my script to do this is :

DatumRange:

LOAD DatumNum

Resident Kalender;

BeginEindVerblijf:

LOAD VerblijfStartNum, VerblijfEindNum, PatiëntId

Resident Patiënt;

Left join(DatumRange)

IntervalMatch(DatumNum, VerblijfStartNum, VerblijfEindNum, PatiëntId)

Load

VerblijfStartNum,

VerblijfEindNum,

PatiëntId

Resident BeginEindVerblijf;

Directory;

Bezetting:

LOAD DatumNum, Date(DatumNum, 'YYYYMMDD') as JaarMaandDag, PatiëntId

Resident DatumRange;

DROP Table DatumRange;

DROP Table BeginEindVerblijf;

But I recieve the error:

Field not found - <PatiëntId>

Bezetting:

LOAD DatumNum, Date(DatumNum, 'YYYYMMDD') as JaarMaandDag, PatiëntId

Resident DatumRange

To my idea, DatumRange is joined together with the table BeginEindVerblijf, so it has to contain the field PatiëntId.

0 Replies