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

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

Set Analysis

Is there a tutorial or something to help with set analysis?

I have a list of patients admitted on a particular day. I have a second table where I want to be able to choose 1 patient and display all their admissions on all days without removing the original filters for date and visitNumber. In other words I want my chart to pay attention to only one of the fields currently selected and ignore all other fields. It looked like I should be able to do that with set analysis, but somehow I can't seem to get the right syntax.

Any help would be appreciated.

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

For set analysis, something like this:

count({1<PatientName={$(varPt)},VisitType-={"Pre*"}>} VisitIDCode)

For a "normal" expression, the wildmatch() function:

count(if(not wildmatch(VisitType,'Pre*'),VisitIDCode))

View solution in original post

7 Replies
Not applicable
Author

Hi,

Please, post an example with a description of issue.

Kindly,

JTPro

eiconsulting
Partner - Creator II
Partner - Creator II

A - I think that what is published in the help file and manual is quite complete, I personally printed it and checked all the samples to understand it well and any time I need something different I go and check it 😉

B - Sorry I cannot test it... you should test something like this

max({$<date= {'*'}>},visitNumber= {'*'}>}fieldname)

.. because it takes all the selections but overwrites the ones in the field visitNumber with "anything"...

Flavio

Federico Sason | Emanuele Briscolini
Not applicable
Author

That still doesn't quite work but was very similar to what I was trying. Where can I find the manual? I cannot find it online.

prieper
Master II
Master II

Hi

you should find it under
C:\Program Files\QlikView\Documentation\QlikView Reference Manual.pdf
(or similar depending the path of your installation)

HTH
Peter

eiconsulting
Partner - Creator II
Partner - Creator II

max({$<date= {'*'},visitNumber= {'*'}>}fieldname)
I tested on a sample and it works for what I understood of yr problem (there was a >} in excess 😉 Here is my test expression: max({$<Customer = {'*'}>}Voto)

I found the most extensive in my "help" files simply looking for SET ANALYSIS (I suppose you did it already! ... but my version is in Italian so that I cannot copy the page here), I also have printed manuals. The download manual for version 9.0 is on http://www.qlik.com/download/ but I didn't check it.

Which version are you working on? Is it a test copy or a valid license?

Flavio

Federico Sason | Emanuele Briscolini
Not applicable
Author

I am working on version 9.0 on a 64 bit server with a valid license. (We upgraded our development server to 9.0 so we could try out some of the new features). I had not done anything with set analysis in 8.5.

Thanks to all who wrote. I was finally able to get it to work using Count({1<PatientName ={$(varPt)}>} VisitIDCode ) .

The varPt is the PatientName with single quotes around it set in a macro that first checks that there is only one patient. It now displays a list of all the patient's visits regardless of the other selections like date or visit type. I could never get it to work without the variable but I had a macro started for this anyway.

I have one more question on this. I'd like to have it also look at the VisitType and exclude those that are "Pre*" as in 'Preadmit', 'PreClinic', 'Presurgical', ... I know I can list out all the types I want to include like below but I haven't been able to exclude a group. Is it possible ? I tried <>, != , not like, ... but couldn't find the syntax to exclude a group. Sometimes the excluded group is much shorter than the included group and it would be handy to know how to do this.

Count({1<PatientName ={$(varPt)}, VisitType = {'Clinic','Emergency','Inpatient','Observation'}>} VisitIDCode )



johnw
Champion III
Champion III

For set analysis, something like this:

count({1<PatientName={$(varPt)},VisitType-={"Pre*"}>} VisitIDCode)

For a "normal" expression, the wildmatch() function:

count(if(not wildmatch(VisitType,'Pre*'),VisitIDCode))